- The
debug
,maxDistance
andminDistance
methods inDoctrine\ODM\MongoDB\Aggregation\Stage\Match
have been deprecated and will be removed in 2.0. - The
Doctrine\ODM\MongoDB\Aggregation\Expr::ensureArray
method will be private in 2.0. - The
Doctrine\ODM\MongoDB\Aggregation\Stage\Bucket::convertExpression
method will be private in 2.0. - The
Doctrine\ODM\MongoDB\Aggregation\Stage\BucketAuto::convertExpression
method will be private in 2.0. - The following methods in
Doctrine\ODM\MongoDB\Aggregation\Stage\GraphLookup
will be private in 2.0:convertExpression
,convertTargetFieldName
. - The
Doctrine\ODM\MongoDB\Aggregation\Stage\ReplaceRoot::convertExpression
method will be private in 2.0. - Calling
Doctrine\MongoDB\Aggregation\Stage\Match::geoWithinPolygon
with fewer than 3 arguments was deprecated and will cause errors in 2.0. A polygon must have at least 3 edges to be considered valid.
- The following methods in
Doctrine\ODM\MongoDB\Configuration
have been deprecated and will be removed in MongoDB ODM 2.0:getLoggerCallable
,getMongoCmd
,getRetryConnect
,getRetryQuery
,setLoggerCallable
,setMongoCmd
,setRetryConnect
,setRetryQuery
. - The
attributes
property will be private in MongoDB ODM 2.0 - if you are extending the configuration class you should no longer rely on it. - The
getDefaultRepositoryClassName
andsetDefaultRepositoryClassName
methods inDoctrine\ODM\MongoDB\Configuration
have been deprecated in favor ofgetDefaultDocumentRepositoryClassName
andsetDefaultDocumentRepositoryClassName
, respectively.
- The
Doctrine\ODM\MongoDB\Cursor
,Doctrine\ODM\MongoDB\CommandCursor
, andDoctrine\ODM\MongoDB\EagerCursor
classes have been deprecated and will be removed in 2.0. Their functionality will be covered by basic iterators. To typehint an ODM specific iterator, use the newDoctrine\ODM\MongoDB\Iterator\Iterator
interface.
Functionality regarding generation of document and repository classes was deprecated and will be dropped in 2.0. The following classes related to this functionality have been deprecated:
Doctrine\ODM\MongoDB\Query\FieldExtractor
Doctrine\ODM\MongoDB\Tools\Console\Command\GenerateDocumentsCommand
Doctrine\ODM\MongoDB\Tools\Console\Command\GenerateRepositoriesCommand
Doctrine\ODM\MongoDB\Tools\DisconnectedClassMetadataFactory
Doctrine\ODM\MongoDB\Tools\DocumentGenerator
Doctrine\ODM\MongoDB\Tools\DocumentRepositoryGenerator
- The
Doctrine\ODM\MongoDB\DocumentManager::createDBRef
method was deprecated in favor ofcreateReference
. It will be dropped in 2.0. - The
Doctrine\ODM\MongoDB\DocumentManager::getConnection
method was deprecated and will be dropped in 2.0. The replacement,getClient
will return aMongoDB\Client
instance, but is not available in 1.x.
- The
Doctrine\ODM\MongoDB\Persisters\DocumentPersister::prepareSortOrProjection
method was deprecated and will be dropped in 2.0. UseprepareSort
orprepareProjection
accordingly.
The default ClassMetadataFactory now triggers an onClassMetadataNotFound
event
when no metadata was found for a given class. The event args contain information
about the loaded class and can store a metadata object which can be used to load
custom metadata when none was found.
The Doctrine\ODM\MongoDB\Tools\ResolveTargetDocumentListener
class now
implements the EventSubscriber
interface. You can still register it as a
listener as was necessary previously, but in order to use new functionality you
have to register it as an event subscriber.
The Doctrine\ODM\MongoDB\Tools\ResolveTargetDocumentListener
class not only
resolves class names when looking up the targetDoccumet
of an association in
a document, but it also uses the new onClassMetadataNotFound
event to resolve
class names and trigger a secondary metadata load cycle if no metadata was found
for the original class name. To use this functionality, either register an event
listener for the onClassMetadataNotFound
event or register the entire class as
an event subscriber.
GridFS support will be rewritten for 2.0 and was deprecated in its current form. A forward compatible layer cannot be provided due to differences in the underlying API.
- The
Doctrine\ODM\MongoDB\Mapping\Annotations\File
annotation was deprecated and will be changed to a class-level annotation in 2.0.
The yaml mapping driver has been deprecated and will be removed in 2.0. Please switch to using annotations or XML mapping files. The following classes have been deprecated:
Doctrine\ODM\MongoDB\Mapping\Driver\YamlDriver
Doctrine\ODM\MongoDB\Mapping\Driver\SimplifiedYamlDriver
The id
attribute to denote identifiers in XML mappings has been deprecated and
will be removed in 2.0. Instead, use the new id
element to map identifiers
instead of mapping them with field
.
With same-namespace resolution, the metadata driver would look for a class of
that name in the same namespace if the given class name didn't contain a
namespace separator (\
). This has been deprecated and will be dropped. Use
fully qualified class names or the ::class
constant instead:
/**
* @ODM\Document(repositoryClass=UserRepository::class)
*/
class User
{
/**
* @ODM\ReferenceMany(targetDocument=Group::class)
*/
private $groups;
}
This affects the repositoryClass
attribute in documents, targetDocument
in
references and embedded relationships as well as class names in discriminator
maps.
The Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo
class has been deprecated
in favor of Doctrine\ODM\MongoDB\Mapping\ClassMetadata
and will be dropped in
2.0.
- The following methods in
Doctrine\ODM\MongoDB\Mapping\ClassMetadata
were deprecated and will be removed in 2.0:getDistance
,getFile
,getNamespace
,isFile
,mapFile
,setDistance
,setFile
,setRequireIndexes
,setSlaveOkay
. - The following properties
Doctrine\ODM\MongoDB\Mapping\ClassMetadata
were deprecated and will be removed in 2.0:distance
,file
,namespace
,requireIndexes
,slaveOkay
.
- The
@NotSaved
annotation was deprecated and will be dropped in 2.0. Use thenotSaved
option on the@Field
,@ReferenceOne
,@ReferenceMany
,@EmbedOne
or@EmbedMany
annotations instead. - Using more than one class-level document annotation (e.g.
@Document
,@MappedSuperclass
) is deprecated and will throw an exception in 2.0. Classes should only be annotated with a single document annotation. - The
dropDups
option on the@Index
annotation was deprecated and will be dropped without replacement in 2.0. This functionality is no longer available. - The
simple
option on the@ReferenceOne
and@ReferenceMany
annotations was deprecated and will be dropped in 2.0. UsestoreAs="id"
instead. - The
@Distance
annotation was deprecated and will be dropped in 2.0. GeoNear queries will no longer be supported, use the aggregation pipeline instead.
- The
writeConcern
attribute in document mappings has been deprecated and will be dropped in 2.0. Usewrite-concern
instead. - The
fieldName
attribute in field mappings has been deprecated and will be dropped in 2.0. Usefield-name
instead. - The
drop-dups
attribute in theindex
element was deprecated and will be dropped without replacement in 2.0. This functionality is no longer available.
When using a discriminator map on a reference or embedded relationship, persisting or loading a class that is not in the map is deprecated and will cause an exception in 2.0. The discriminator map must contain all possible classes that can be referenced or be omitted completely.
Mapping two fields with the same name in the database is deprecated and will
cause an exception in 2.0. It is possible to have multiple fields with the same
name in the database as long as all but one of them have the notSaved
option
set.
- The
delete
andupdate
methods inDoctrine\ODM\MongoDB\Persisters\CollectionPersister
are deprecated. UsedeleteAll
andupdateAll
instead. The method signatures will be adapted to match those ofdeleteAll
andupdateAll
in 2.0.
- The usage of proxies from Doctrine Common was deprecated and will be replaced
with
ocramius/proxy-manager
in 2.0. - Using the
AUTOGENERATE_ALWAYS
andAUTOGENERATE_NEVER
strategies is deprecated and will be dropped in 2.0. UseAUTOGENERATE_FILE_NOT_EXISTS
andAUTOGENERATE_EVAL
instead. - The
Doctrine\ODM\MongoDB\Proxy\ProxyFactory
class was deprecated and will be dropped in 2.0. - The
Doctrine\ODM\MongoDB\Proxy\Proxy
interface was deprecated and will be dropped in 2.0.
- The
eagerCursor
method inDoctrine\ODM\MongoDB\Query\Builder
was deprecated and will be dropped in 2.0. This functionality is no longer available. - The
eager
option inDoctrine\ODM\MongoDB\Query\Query
was deprecated and will be dropped in 2.0. This functionality is no longer available. - The
geoNear
,group
, andmapReduce
query types were deprecated and will be dropped in 2.0. Use aggregation pipeline features instead. - The following methods in
Doctrine\ODM\MongoDB\Query\Builder
were deprecated and will be dropped in 2.0:mapReduce
,map
,reduce
,finalize
,out
,mapReduceOptions
,distanceMultiplier
,geoNear
,spherical
. - The following properties in
Doctrine\ODM\MongoDB\Query\Builder
will be private in MongoDB ODM 2.0:collection
,expr
,query
. - The following properties in
Doctrine\ODM\MongoDB\Query\Expr
will be private in MongoDB ODM 2.0:currentField
,newObj
,query
. - The
addManyToSet
andpushAll
methods inDoctrine\ODM\MongoDB\Query\Builder
andDoctrine\ODM\MongoDB\Query\Expr
were deprecated and will be removed in 2.0. Useeach
in combination withaddToSet
andpush
respectively. - The following methods from
Doctrine\ODM\MongoDB\Query\Builder
andDoctrine\ODM\MongoDB\Query\Expr
were deprecated and will be removed in 2.0:maxDistance
,minDistance
,withinBox
,withinCenter
,withinCenterSphere
,withinPolygon
. - The
Doctrine\MongoDB\Query\Query::count
method was deprecated and will be removed in MongoDB ODM 2.0. Iterators will not be countable in 2.0. Users should run separate count queries instead. - The
Doctrine\MongoDB\Query\Query::iterate
method was deprecated and will be removed in MongoDB ODM 2.0. UseDoctrine\MongoDB\Query\Query::getIterator
instead. - The following properties in
Doctrine\ODM\MongoDB\Query\Query
will be private in MongoDB ODM 2.0:iterator
,options
,query
. - The following constants in
Doctrine\ODM\MongoDB\Query\Query
will be removed in MongoDB ODM 2.0:HINT_READ_PREFERENCE_TAGS
,HINT_SLAVE_OKAY
,TYPE_GEO_NEAR
. - The
Doctrine\ODM\MongoDB\Query\Query::prepareCursor
method will be removed in MongoDB ODM 2.0. You should wrap the returned cursor instead. - Calling
Doctrine\MongoDB\Query\Builder::geoWithinPolygon
andDoctrine\MongoDB\Query\Expr::geoWithinPolygon
with fewer than 3 arguments was deprecated and will cause errors in 2.0. A polygon must have at least 3 edges to be considered valid.
- The
Doctrine\ODM\MongoDB\DocumentRepository
class was deprecated in favor ofDoctrine\ODM\MongoDB\Repository\DocumentRepository
and will be dropped in 2.0.
- The
timeout
option in theodm:schema:create
andodm:schema:update
commands was deprecated and will be dropped in 2.0. Use themaxTimeMs
option instead. - The
indexOptions
argument in theensureSharding
andensureDocumentSharding
methods was deprecated and will be dropped in 2.0.
- The following classes in the
Doctrine\ODM\MongoDB\Types
namespace were deprecated and will be removed in 2.0:FileType
,IncrementType
. - The
FILE
andINCREMENT
constants inDoctrine\ODM\MongoDB\Types\Type
were deprecated and will be removed in 2.0.
- The
isScheduledForDirtyCheck
andscheduleForDirtyCheck
methods inDoctrine\ODM\MongoDB\UnitOfWork
have been deprecated and will be dropped in 2.0. UseisScheduledForSynchronization
andscheduleForSynchronization
instead.