Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2031

doctrine:generate:entities - Alternate (scoped) Namespace Syntax not supported

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      My preferred Syntax:

      namespace foo
      {
      use ...;
      class

      { ... }

      }

      seems not to be supported.

      Setters/Getters are inserted before the last curly closing bracket - but that is the closing Namespace scope!

        Activity

        Hide
        Marco Pivetta added a comment -

        Alternate code generators project is not yet on roadmap.

        Show
        Marco Pivetta added a comment - Alternate code generators project is not yet on roadmap.
        Hide
        Marco Pivetta added a comment -

        Christophe Coevoet yes, but I think the code generator becomes quite too complex when we add all these details... What I was thinking is that using an alternate syntax to ease the task Ilja Laurillard exposed as an example is anyway a bit weak. I don't see this coming without code generation projects going on first.

        Show
        Marco Pivetta added a comment - Christophe Coevoet yes, but I think the code generator becomes quite too complex when we add all these details... What I was thinking is that using an alternate syntax to ease the task Ilja Laurillard exposed as an example is anyway a bit weak. I don't see this coming without code generation projects going on first.
        Hide
        Christophe Coevoet added a comment -

        @Marco The issue is not about creting a class cache but about editing entities with the EntityGenerator when the code uses the syntax with braces.

        Show
        Christophe Coevoet added a comment - @Marco The issue is not about creting a class cache but about editing entities with the EntityGenerator when the code uses the syntax with braces.
        Hide
        Marco Pivetta added a comment -

        Ilja Laurillard not really sure classcache is doctrine's problem. Playing with reflection, any third party (Symfony2 here) can handle that without string concat

        Show
        Marco Pivetta added a comment - Ilja Laurillard not really sure classcache is doctrine's problem. Playing with reflection, any third party (Symfony2 here) can handle that without string concat
        Hide
        Ilja Laurillard added a comment -

        One namespace per file may be correct, but only considering autoloading issues.
        Have a look to the symfony "bootstrap.php.cache" file for an example of multiple namespace and classes.
        Doctrine should have a similar "compiling" option.

        I know of the standard syntax - thats why i wrote: "my preferred syntax".

        I just may live with the standard syntax - you may want to at least mention in the docs that you have to use standard syntax, else your compiled entities fatal.

        Show
        Ilja Laurillard added a comment - One namespace per file may be correct, but only considering autoloading issues. Have a look to the symfony "bootstrap.php.cache" file for an example of multiple namespace and classes. Doctrine should have a similar "compiling" option. I know of the standard syntax - thats why i wrote: "my preferred syntax". I just may live with the standard syntax - you may want to at least mention in the docs that you have to use standard syntax, else your compiled entities fatal.
        Hide
        Marco Pivetta added a comment - - edited

        Ilja Laurillard entities are per-file anyway, you'd have only one namespace.

        namespace Foo
        {
            use AAA;
            class Bar {}
        }
        

        is exactly like writing

        namespace Foo
        use AAA;
        class Bar {}
        
        Show
        Marco Pivetta added a comment - - edited Ilja Laurillard entities are per-file anyway, you'd have only one namespace. namespace Foo { use AAA; class Bar {} } is exactly like writing namespace Foo use AAA; class Bar {}

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Ilja Laurillard
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: