When using typed properties on Document classes, Doctrine will use these types to set defaults mapping types.
If you have defined some properties like:
#[Field]
private int $myProp;
This property will be stored in DB as string
but casted back to int
. Please note that at this
time, due to backward compatibility reasons, nullable type does not imply nullable
mapping.
ODM now supports two major versions of doctrine/persistence
and provides forward compatibility where possible.
We strongly recommend checking package's upgrade notes
and ODM's todo list. Please require 2.x version of
doctrine/persistence
in your composer.json should you need to use functionalities without a forward
compatibility layer. Most notable examples are:
- removed
LifecycleEventArgs::getEntity()
- removed support for short namespace aliases
That method was inherited from the abstract AnnotationDriver
class of
doctrine/persistence
, and does not seem to serve any purpose.
Detaching all documents of a given class has been deprecated. We deem the process fragile and suggest
detaching your documents one-by-one using DocumentManager::detach()
. This effectively deprecates
OnClearEventArgs::getDocumentClass
and OnClearEventArgs::clearsAllDocuments
.
The NOTIFY
change tracking policy has been deprecated. We suggest to use DEFERRED_EXPLICIT
strategy instead. This effectively deprecates ClassMetadata::isChangeTrackingNotify
and
ClassMetadata::CHANGETRACKING_NOTIFY
.