summaryrefslogtreecommitdiff
path: root/vendor/doctrine/persistence/UPGRADE.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/persistence/UPGRADE.md')
-rw-r--r--vendor/doctrine/persistence/UPGRADE.md154
1 files changed, 154 insertions, 0 deletions
diff --git a/vendor/doctrine/persistence/UPGRADE.md b/vendor/doctrine/persistence/UPGRADE.md
new file mode 100644
index 0000000..d7f5b04
--- /dev/null
+++ b/vendor/doctrine/persistence/UPGRADE.md
@@ -0,0 +1,154 @@
1Note about upgrading: Doctrine uses static and runtime mechanisms to raise
2awareness about deprecated code.
3
4- Use of `@deprecated` docblock that is detected by IDEs (like PHPStorm) or
5 Static Analysis tools (like Psalm, phpstan)
6- Use of our low-overhead runtime deprecation API, details:
7 https://github.com/doctrine/deprecations/
8
9# Upgrade to 3.3
10
11## Added method `ObjectManager::isUninitializedObject()`
12
13Classes implementing `Doctrine\Persistence\ObjectManager` should implement the new
14method. This method will be added to the interface in 4.0.
15
16# Upgrade to 3.1
17
18## Deprecated `RuntimePublicReflectionProperty`
19
20Use `RuntimeReflectionProperty` instead.
21
22# Upgrade to 3.0
23
24## Removed `OnClearEventArgs::clearsAllEntities()` and `OnClearEventArgs::getEntityClass()`
25
26These methods only make sense when partially clearing the object manager, which
27is no longer possible.
28The second argument of the constructor of `OnClearEventArgs` is removed as well.
29
30## BC Break: removed `ObjectManagerAware`
31
32Implement active record style functionality directly in your application, by
33using a `postLoad` event.
34
35## BC Break: removed `AnnotationDriver`
36
37Use `ColocatedMappingDriver` instead.
38
39## BC Break: Removed `MappingException::pathRequired()`
40
41Use `MappingException::pathRequiredForDriver()` instead.
42
43## BC Break: removed `LifecycleEventArgs::getEntity()`
44
45Use `LifecycleEventArgs::getObject()` instead.
46
47## BC Break: removed support for short namespace aliases
48
49- `AbstractClassMetadataFactory::getFqcnFromAlias()` is removed.
50- `ClassMetadataFactory` methods now require their `$className` argument to be an
51actual FQCN.
52
53## BC Break: removed `ObjectManager::merge()`
54
55`ObjectManagerDecorator::merge()` is removed without replacement.
56
57## BC Break: removed support for `doctrine/cache`
58
59Removed support for using doctrine/cache for metadata caching. The
60`setCacheDriver` and `getCacheDriver` methods have been removed from
61`Doctrine\Persistence\Mapping\AbstractMetadata`. Please use `getCache` and
62`setCache` with a PSR-6 implementation instead.
63
64## BC Break: changed signatures
65
66`$objectName` has been dropped from the signature of `ObjectManager::clear()`.
67
68```diff
69- public function clear($objectName = null)
70+ public function clear(): void
71```
72
73Also, native parameter type declarations have been added on all public APIs.
74Native return type declarations have not been added so that it is possible to
75implement types compatible with both 2.x and 3.x.
76
77## BC Break: Removed `PersistentObject`
78
79Please implement this functionality directly in your application if you want
80ActiveRecord style functionality.
81
82# Upgrade to 2.5
83
84## Deprecated `OnClearEventArgs::clearsAllEntities()` and `OnClearEventArgs::getEntityClass()`
85
86These methods only make sense when partially clearing the object manager, which
87is deprecated.
88Passing a second argument to the constructor of `OnClearEventArgs` is
89deprecated as well.
90
91## Deprecated `ObjectManagerAware`
92
93Along with deprecating `PersistentObject`, deprecating `ObjectManagerAware`
94means deprecating support for active record, which already came with a word of
95warning. Please implement this directly in your application with a `postLoad`
96event if you need active record style functionality.
97
98## Deprecated `MappingException::pathRequired()`
99
100`MappingException::pathRequiredForDriver()` should be used instead.
101
102# Upgrade to 2.4
103
104## Deprecated `AnnotationDriver`
105
106Since attributes were introduced in PHP 8.0, annotations are deprecated.
107`AnnotationDriver` is an abstract class that is used when implementing concrete
108annotation drivers in dependent packages. It is deprecated in favor of using
109`ColocatedMappingDriver` to implement both annotation and attribute based
110drivers. This will involve implementing `isTransient()` as well as
111`__construct()` and `getReader()` to retain backward compatibility.
112
113# Upgrade to 2.3
114
115## Deprecated using short namespace alias syntax in favor of `::class` syntax.
116
117Before:
118
119```php
120$objectManager->find('MyPackage:MyClass', $id);
121$objectManager->createQuery('SELECT u FROM MyPackage:MyClass');
122```
123
124After:
125
126```php
127$objectManager->find(MyClass::class, $id);
128$objectManager->createQuery('SELECT u FROM '. MyClass::class);
129```
130
131# Upgrade to 2.2
132
133## Deprecated `doctrine/cache` usage for metadata caching
134
135The `setCacheDriver` and `getCacheDriver` methods in
136`Doctrine\Persistence\Mapping\AbstractMetadata` have been deprecated. Please
137use `getCache` and `setCache` with a PSR-6 implementation instead. Note that
138even after switching to PSR-6, `getCacheDriver` will return a cache instance
139that wraps the PSR-6 cache. Note that if you use a custom implementation of
140doctrine/cache, the library may not be able to provide a forward compatibility
141layer. The cache implementation MUST extend the
142`Doctrine\Common\Cache\CacheProvider` class.
143
144# Upgrade to 1.2
145
146## Deprecated `ObjectManager::merge()` and `ObjectManager::detach()`
147
148Please handle merge operations in your application, and use
149`ObjectManager::clear()` instead.
150
151## Deprecated `PersistentObject`
152
153Please implement this functionality directly in your application if you want
154ActiveRecord style functionality.