@@ -65,53 +65,6 @@ Configuration Options
6565The following sections describe all the configuration options
6666available on a ``Doctrine\ORM\Configuration `` instance.
6767
68- Native Lazy Objects (**OPTIONAL **)
69- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70-
71- With PHP 8.4 we recommend that you use native lazy objects instead of
72- the code generation approach using the ``symfony/var-exporter `` Ghost trait.
73-
74- With Doctrine 4, the minimal requirement will become PHP 8.4 and native lazy objects
75- will become the only approach to lazy loading.
76-
77- .. code-block :: php
78-
79- <?php
80- $config->enableNativeLazyObjects(true);
81-
82- Proxy Directory
83- ~~~~~~~~~~~~~~~
84-
85- Required except if you use native lazy objects with PHP 8.4.
86- This setting will be removed in the future.
87-
88- .. code-block :: php
89-
90- <?php
91- $config->setProxyDir($dir);
92- $config->getProxyDir();
93-
94- Gets or sets the directory where Doctrine generates any proxy
95- classes. For a detailed explanation on proxy classes and how they
96- are used in Doctrine, refer to the "Proxy Objects" section further
97- down.
98-
99- Proxy Namespace
100- ~~~~~~~~~~~~~~~
101-
102- Required except if you use native lazy objects with PHP 8.4.
103- This setting will be removed in the future.
104-
105- .. code-block :: php
106-
107- <?php
108- $config->setProxyNamespace($namespace);
109- $config->getProxyNamespace();
110-
111- Gets or sets the namespace to use for generated proxy classes. For
112- a detailed explanation on proxy classes and how they are used in
113- Doctrine, refer to the "Proxy Objects" section further down.
114-
11568Metadata Driver (**REQUIRED **)
11669~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11770
@@ -211,63 +164,6 @@ Gets or sets the logger to use for logging all SQL statements
211164executed by Doctrine. The logger class must implement the
212165deprecated ``Doctrine\DBAL\Logging\SQLLogger `` interface.
213166
214- Auto-generating Proxy Classes (**OPTIONAL **)
215- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216-
217- This setting is not required if you use native lazy objects with PHP 8.4
218- and will be removed in the future.
219-
220- Proxy classes can either be generated manually through the Doctrine
221- Console or automatically at runtime by Doctrine. The configuration
222- option that controls this behavior is:
223-
224- .. code-block :: php
225-
226- <?php
227- $config->setAutoGenerateProxyClasses($mode);
228-
229- Possible values for ``$mode `` are:
230-
231- - ``Doctrine\ORM\Proxy\ProxyFactory::AUTOGENERATE_NEVER ``
232-
233- Never autogenerate a proxy. You will need to generate the proxies
234- manually, for this use the Doctrine Console like so:
235-
236- .. code-block :: php
237-
238- $ ./doctrine orm:generate-proxies
239-
240- When you do this in a development environment,
241- be aware that you may get class/file not found errors if certain proxies
242- are not yet generated. You may also get failing lazy-loads if new
243- methods were added to the entity class that are not yet in the proxy class.
244- In such a case, simply use the Doctrine Console to (re)generate the
245- proxy classes.
246-
247- - ``Doctrine\ORM\Proxy\ProxyFactory::AUTOGENERATE_ALWAYS ``
248-
249- Always generates a new proxy in every request and writes it to disk.
250-
251- - ``Doctrine\ORM\Proxy\ProxyFactory::AUTOGENERATE_FILE_NOT_EXISTS ``
252-
253- Generate the proxy class when the proxy file does not exist.
254- This strategy causes a file exists call whenever any proxy is
255- used the first time in a request.
256-
257- - ``Doctrine\ORM\Proxy\ProxyFactory::AUTOGENERATE_EVAL ``
258-
259- Generate the proxy classes and evaluate them on the fly via eval(),
260- avoiding writing the proxies to disk.
261- This strategy is only sane for development.
262-
263- In a production environment, it is highly recommended to use
264- AUTOGENERATE_NEVER to allow for optimal performances. The other
265- options are interesting in development environment.
266-
267- ``setAutoGenerateProxyClasses `` can accept a boolean
268- value. This is still possible, ``FALSE `` being equivalent to
269- AUTOGENERATE_NEVER and ``TRUE `` to AUTOGENERATE_ALWAYS.
270-
271167Development vs Production Configuration
272168---------------------------------------
273169
@@ -383,55 +279,6 @@ transparently initialize itself on first access.
383279 This will override the 'fetch' option specified in the mapping for
384280 that association, but only for that query.
385281
386-
387- Generating Proxy classes
388- ~~~~~~~~~~~~~~~~~~~~~~~~
389-
390- In a production environment, it is highly recommended to use
391- ``AUTOGENERATE_NEVER `` to allow for optimal performances.
392- However you will be required to generate the proxies manually
393- using the Doctrine Console:
394-
395- .. code-block :: php
396-
397- $ ./doctrine orm:generate-proxies
398-
399- The other options are interesting in development environment:
400-
401- - ``AUTOGENERATE_ALWAYS `` will require you to create and configure
402- a proxy directory. Proxies will be generated and written to file
403- on each request, so any modification to your code will be acknowledged.
404-
405- - ``AUTOGENERATE_FILE_NOT_EXISTS `` will not overwrite an existing
406- proxy file. If your code changes, you will need to regenerate the
407- proxies manually.
408-
409- - ``AUTOGENERATE_EVAL `` will regenerate each proxy on each request,
410- but without writing them to disk.
411-
412- Autoloading Proxies
413- -------------------
414-
415- When you deserialize proxy objects from the session or any other storage
416- it is necessary to have an autoloading mechanism in place for these classes.
417- For implementation reasons Proxy class names are not PSR-0 compliant. This
418- means that you have to register a special autoloader for these classes:
419-
420- .. code-block :: php
421-
422- <?php
423- use Doctrine\ORM\Proxy\Autoloader;
424-
425- $proxyDir = "/path/to/proxies";
426- $proxyNamespace = "MyProxies";
427-
428- Autoloader::register($proxyDir, $proxyNamespace);
429-
430- If you want to execute additional logic to intercept the proxy file not found
431- state you can pass a closure as the third argument. It will be called with
432- the arguments proxydir, namespace and className when the proxy file could not
433- be found.
434-
435282Multiple Metadata Sources
436283-------------------------
437284
0 commit comments