Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-112

[PATCH] Allow Hydrator classes to be regenerated only if they are absent

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0BETA2
    • Fix Version/s: 1.0.0BETA2
    • Component/s: Hydration
    • Labels:
      None

      Description

      Hydrator classes are either never generated ou regenerated on each request.

      The patch add another case : regenerate only if absent.

      HydratorFactory::$autoGenerate switches to int and can have 3 values : HydratorFactory::AUTOGENERATE_NEVER, HydratorFactory::AUTOGENERATE_ALWAYS or HydratorFactory::AUTOGENERATE_ABSENT

      1. autogenerate.patch
        6 kB
        JF Bustarret
      2. autogenerate.patch
        3 kB
        JF Bustarret

        Activity

        Hide
        Jonathan H. Wage added a comment -

        Hi, I don't think this is quite right. We should make this feature match the way proxies are generated. We will need to add a console command to generate the proxies for production.

        Show
        Jonathan H. Wage added a comment - Hi, I don't think this is quite right. We should make this feature match the way proxies are generated. We will need to add a console command to generate the proxies for production.
        Hide
        JF Bustarret added a comment -

        A console command would need to know the configuration of the factories... It can't be a standalone script.

        A symfony script would be great (provided it works with symfony < 2), but what about non symfony users ?

        I added Proxies to my patch, and switched the two const to the Configuration class.

        Show
        JF Bustarret added a comment - A console command would need to know the configuration of the factories... It can't be a standalone script. A symfony script would be great (provided it works with symfony < 2), but what about non symfony users ? I added Proxies to my patch, and switched the two const to the Configuration class.
        Hide
        JF Bustarret added a comment - - edited

        Updated patch with proxies

        Show
        JF Bustarret added a comment - - edited Updated patch with proxies
        Hide
        Jonathan H. Wage added a comment -

        Hi, I added the console commands for generating proxy and hydrator clases here https://github.com/doctrine/mongodb-odm/commit/56fc267459dd0b972e710b0ff1cab5fbf1859fd9

        It will be integrated with DoctrineMongoDBBundle soon.

        Show
        Jonathan H. Wage added a comment - Hi, I added the console commands for generating proxy and hydrator clases here https://github.com/doctrine/mongodb-odm/commit/56fc267459dd0b972e710b0ff1cab5fbf1859fd9 It will be integrated with DoctrineMongoDBBundle soon.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            JF Bustarret
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: