UPGRADE_TO_ALPHA3 2.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Upgrade from 2.0-ALPHA2 to 2.0-ALPHA3
  2. This section details the changes made to Doctrine 2.0-ALPHA3 to make it easier for you
  3. to upgrade your projects to use this version.
  4. ## CLI Changes
  5. The $args variable used in the cli-config.php for configuring the Doctrine CLI has been renamed to $globalArguments.
  6. ## Proxy class changes
  7. You are now required to make supply some minimalist configuration with regards to proxy objects. That involves 2 new configuration options. First, the directory where generated proxy classes should be placed needs to be specified. Secondly, you need to configure the namespace used for proxy classes. The following snippet shows an example:
  8. [php]
  9. // step 1: configure directory for proxy classes
  10. // $config instanceof Doctrine\ORM\Configuration
  11. $config->setProxyDir('/path/to/myproject/lib/MyProject/Generated/Proxies');
  12. $config->setProxyNamespace('MyProject\Generated\Proxies');
  13. Note that proxy classes behave exactly like any other classes when it comes to class loading. Therefore you need to make sure the proxy classes can be loaded by some class loader. If you place the generated proxy classes in a namespace and directory under your projects class files, like in the example above, it would be sufficient to register the MyProject namespace on a class loader. Since the proxy classes are contained in that namespace and adhere to the standards for class loading, no additional work is required.
  14. Generating the proxy classes into a namespace within your class library is the recommended setup.
  15. Entities with initialized proxy objects can now be serialized and unserialized properly from within the same application.
  16. For more details refer to the Configuration section of the manual.
  17. ## Removed allowPartialObjects configuration option
  18. The allowPartialObjects configuration option together with the `Configuration#getAllowPartialObjects` and `Configuration#setAllowPartialObjects` methods have been removed.
  19. The new behavior is as if the option were set to FALSE all the time, basically disallowing partial objects globally. However, you can still use the `Query::HINT_FORCE_PARTIAL_LOAD` query hint to force a query to return partial objects for optimization purposes.
  20. ## Renamed Methods
  21. * Doctrine\ORM\Configuration#getCacheDir() to getProxyDir()
  22. * Doctrine\ORM\Configuration#setCacheDir($dir) to setProxyDir($dir)