Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-263

YAML and XML Driver do not support cascading options "all", "detach". Also: Improvement of YAML Syntax (Patch attached)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA3
    • Fix Version/s: 2.0-ALPHA4
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None

      Description

      Hi there,

      I've attached a small patch which addresses the following issues:

      -> YAML did not support cascading options "all" (as described in documentation) and "detach" (as used in AssociationMapping class). The attached patch fixes that.

      -> XML does not support these things either, but the attached patch DOES NOT FIX THAT (see below).

      Also addressed:

      YAML had syntax like cascadeRemove, cascadePersist etc., but the documentation for the annotation driver uses only "persist, remove" etc.

      This patch changes the syntax to the following:

      cascade: [ persist, remove ]

      OR

      cascade:

      • persist
      • remove

      (Both work!)

      It is now also possible to use cascade: [all]

      The YAML Driver was changed in that way that he must not know about the currently supported cascate actions. This has been pushed towards the AssociationMapping and I strongly believe that this is the right way.

      On the other hand, I did not change the XML Driver functionality. It does still know about the cascade actions and does most probably not support the detach and "all" actions. That should be fixed, but won't take too long.

      1. MappingDriversCascade.patch
        10 kB
        Christian Heinrich
      2. MappingDriversCascade.patch
        10 kB
        Christian Heinrich
      3. YamlDriver_change_cascade_syntax.php.patch
        4 kB
        Christian Heinrich

        Activity

        Hide
        Christian Heinrich added a comment -
        • YAML Driver fixed.
        • XML Driver fixed (supports now both cascade-persist and (because the other drivers do not use the prefixed cascade-) single "persist")
        • I've modified the UnitTests to cover cascade="all" for XML & YAML
        Show
        Christian Heinrich added a comment - YAML Driver fixed. XML Driver fixed (supports now both cascade-persist and (because the other drivers do not use the prefixed cascade-) single "persist") I've modified the UnitTests to cover cascade="all" for XML & YAML
        Hide
        Roman S. Borschel added a comment -

        That patch looks good but there seem to be tabs in your patches. Please make sure that you use "soft tabs" (4 spaces) in your editor.

        Show
        Roman S. Borschel added a comment - That patch looks good but there seem to be tabs in your patches. Please make sure that you use "soft tabs" (4 spaces) in your editor.
        Hide
        Christian Heinrich added a comment -

        Resolved tab issue.

        Show
        Christian Heinrich added a comment - Resolved tab issue.
        Hide
        Roman S. Borschel added a comment -

        Patch applied. Thanks! So this will be included in todays ALPHA4 release.

        Show
        Roman S. Borschel added a comment - Patch applied. Thanks! So this will be included in todays ALPHA4 release.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Christian Heinrich
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: