diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeDriver.php index 4b28504c1..17a515a49 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeDriver.php @@ -241,6 +241,14 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad } if ($propertyAttribute instanceof ODM\Indexes) { + trigger_deprecation( + 'doctrine/mongodb-odm', + '2.2', + 'The "@Indexes" attribute used in property "%s" of class "%s" is deprecated. Specify all "@Index" and "@UniqueIndex" attributes on the class.', + $property->getName(), + $className, + ); + $value = $propertyAttribute->value; foreach (is_array($value) ? $value : [$value] as $index) { $indexes[] = $index;