diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php index 64778f7e05..035fa5b0ae 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php @@ -1434,6 +1434,17 @@ public function mapField(array $mapping) throw MappingException::atomicCollectionStrategyNotAllowed($mapping['strategy'], $this->name, $mapping['fieldName']); } + if (isset($mapping['repositoryMethod']) && ! (empty($mapping['skip']) && empty($mapping['limit']) && empty($mapping['sort']))) { + @trigger_error( + sprintf( + "Combining 'repositoryMethod' with skip, limit or sort (used on '%s' in class '%s') was deprecated in 1.3 and will be removed in 2.0. Please include those in the repository method itself.", + $mapping['fieldName'], + $this->name + ), + E_USER_DEPRECATED + ); + } + if (isset($mapping['reference']) && $mapping['type'] === 'one') { $mapping['association'] = self::REFERENCE_ONE; }