123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937 |
- <?php
- /*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the MIT license. For more information, see
- * <http://www.doctrine-project.org>.
- */
- namespace Doctrine\ORM\Mapping;
- use Doctrine\ORM\ORMException;
- use ReflectionException;
- use function array_keys;
- use function array_map;
- use function array_values;
- use function get_parent_class;
- use function implode;
- use function sprintf;
- /**
- * A MappingException indicates that something is wrong with the mapping setup.
- */
- class MappingException extends ORMException
- {
- /**
- * @return MappingException
- */
- public static function pathRequired()
- {
- return new self('Specifying the paths to your entities is required ' .
- 'in the AnnotationDriver to retrieve all class names.');
- }
- /**
- * @param string $entityName
- *
- * @return MappingException
- */
- public static function identifierRequired($entityName)
- {
- $parent = get_parent_class($entityName);
- if ($parent !== false) {
- return new self(sprintf(
- 'No identifier/primary key specified for Entity "%s" sub class of "%s". Every Entity must have an identifier/primary key.',
- $entityName,
- $parent
- ));
- }
- return new self(sprintf(
- 'No identifier/primary key specified for Entity "%s". Every Entity must have an identifier/primary key.',
- $entityName
- ));
- }
- /**
- * @param string $entityName
- * @param string $type
- *
- * @return MappingException
- */
- public static function invalidInheritanceType($entityName, $type)
- {
- return new self(sprintf("The inheritance type '%s' specified for '%s' does not exist.", $type, $entityName));
- }
- /**
- * @return MappingException
- */
- public static function generatorNotAllowedWithCompositeId()
- {
- return new self("Id generators can't be used with a composite id.");
- }
- /**
- * @param string $entity
- *
- * @return MappingException
- */
- public static function missingFieldName($entity)
- {
- return new self(sprintf(
- "The field or association mapping misses the 'fieldName' attribute in entity '%s'.",
- $entity
- ));
- }
- /**
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function missingTargetEntity($fieldName)
- {
- return new self(sprintf("The association mapping '%s' misses the 'targetEntity' attribute.", $fieldName));
- }
- /**
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function missingSourceEntity($fieldName)
- {
- return new self(sprintf("The association mapping '%s' misses the 'sourceEntity' attribute.", $fieldName));
- }
- /**
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function missingEmbeddedClass($fieldName)
- {
- return new self(sprintf("The embed mapping '%s' misses the 'class' attribute.", $fieldName));
- }
- /**
- * @param string $entityName
- * @param string $fileName
- *
- * @return MappingException
- */
- public static function mappingFileNotFound($entityName, $fileName)
- {
- return new self(sprintf("No mapping file found named '%s' for class '%s'.", $fileName, $entityName));
- }
- /**
- * Exception for invalid property name override.
- *
- * @param string $className The entity's name.
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function invalidOverrideFieldName($className, $fieldName)
- {
- return new self(sprintf("Invalid field override named '%s' for class '%s'.", $fieldName, $className));
- }
- /**
- * Exception for invalid property type override.
- *
- * @param string $className The entity's name.
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function invalidOverrideFieldType($className, $fieldName)
- {
- return new self(sprintf(
- "The column type of attribute '%s' on class '%s' could not be changed.",
- $fieldName,
- $className
- ));
- }
- /**
- * @param string $className
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function mappingNotFound($className, $fieldName)
- {
- return new self(sprintf("No mapping found for field '%s' on class '%s'.", $fieldName, $className));
- }
- /**
- * @param string $className
- * @param string $queryName
- *
- * @return MappingException
- */
- public static function queryNotFound($className, $queryName)
- {
- return new self(sprintf("No query found named '%s' on class '%s'.", $queryName, $className));
- }
- /**
- * @param string $className
- * @param string $resultName
- *
- * @return MappingException
- */
- public static function resultMappingNotFound($className, $resultName)
- {
- return new self(sprintf("No result set mapping found named '%s' on class '%s'.", $resultName, $className));
- }
- /**
- * @param string $entity
- * @param string $queryName
- *
- * @return MappingException
- */
- public static function emptyQueryMapping($entity, $queryName)
- {
- return new self(sprintf('Query named "%s" in "%s" could not be empty.', $queryName, $entity));
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function nameIsMandatoryForQueryMapping($className)
- {
- return new self(sprintf("Query name on entity class '%s' is not defined.", $className));
- }
- /**
- * @param string $entity
- * @param string $queryName
- *
- * @return MappingException
- */
- public static function missingQueryMapping($entity, $queryName)
- {
- return new self(sprintf(
- 'Query named "%s" in "%s requires a result class or result set mapping.',
- $queryName,
- $entity
- ));
- }
- /**
- * @param string $entity
- * @param string $resultName
- *
- * @return MappingException
- */
- public static function missingResultSetMappingEntity($entity, $resultName)
- {
- return new self(sprintf(
- 'Result set mapping named "%s" in "%s requires a entity class name.',
- $resultName,
- $entity
- ));
- }
- /**
- * @param string $entity
- * @param string $resultName
- *
- * @return MappingException
- */
- public static function missingResultSetMappingFieldName($entity, $resultName)
- {
- return new self(sprintf(
- 'Result set mapping named "%s" in "%s requires a field name.',
- $resultName,
- $entity
- ));
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function nameIsMandatoryForSqlResultSetMapping($className)
- {
- return new self(sprintf("Result set mapping name on entity class '%s' is not defined.", $className));
- }
- /**
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function oneToManyRequiresMappedBy($fieldName)
- {
- return new self(sprintf("OneToMany mapping on field '%s' requires the 'mappedBy' attribute.", $fieldName));
- }
- /**
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function joinTableRequired($fieldName)
- {
- return new self(sprintf("The mapping of field '%s' requires an the 'joinTable' attribute.", $fieldName));
- }
- /**
- * Called if a required option was not found but is required
- *
- * @param string $field Which field cannot be processed?
- * @param string $expectedOption Which option is required
- * @param string $hint Can optionally be used to supply a tip for common mistakes,
- * e.g. "Did you think of the plural s?"
- *
- * @return MappingException
- */
- public static function missingRequiredOption($field, $expectedOption, $hint = '')
- {
- $message = "The mapping of field '" . $field . "' is invalid: The option '" . $expectedOption . "' is required.";
- if (! empty($hint)) {
- $message .= ' (Hint: ' . $hint . ')';
- }
- return new self($message);
- }
- /**
- * Generic exception for invalid mappings.
- *
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function invalidMapping($fieldName)
- {
- return new self(sprintf("The mapping of field '%s' is invalid.", $fieldName));
- }
- /**
- * Exception for reflection exceptions - adds the entity name,
- * because there might be long classnames that will be shortened
- * within the stacktrace
- *
- * @param string $entity The entity's name
- *
- * @return MappingException
- */
- public static function reflectionFailure($entity, ReflectionException $previousException)
- {
- return new self(sprintf('An error occurred in %s', $entity), 0, $previousException);
- }
- /**
- * @param string $className
- * @param string $joinColumn
- *
- * @return MappingException
- */
- public static function joinColumnMustPointToMappedField($className, $joinColumn)
- {
- return new self(sprintf(
- 'The column %s must be mapped to a field in class %s since it is referenced by a join column of another class.',
- $joinColumn,
- $className
- ));
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function classIsNotAValidEntityOrMappedSuperClass($className)
- {
- $parent = get_parent_class($className);
- if ($parent !== false) {
- return new self(sprintf(
- 'Class "%s" sub class of "%s" is not a valid entity or mapped super class.',
- $className,
- $parent
- ));
- }
- return new self(sprintf(
- 'Class "%s" is not a valid entity or mapped super class.',
- $className
- ));
- }
- /**
- * @param string $className
- * @param string $propertyName
- *
- * @return MappingException
- */
- public static function propertyTypeIsRequired($className, $propertyName)
- {
- return new self(sprintf(
- "The attribute 'type' is required for the column description of property %s::\$%s.",
- $className,
- $propertyName
- ));
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function tableIdGeneratorNotImplemented($className)
- {
- return new self(sprintf('TableIdGenerator is not yet implemented for use with class %s', $className));
- }
- /**
- * @param string $entity The entity's name.
- * @param string $fieldName The name of the field that was already declared.
- *
- * @return MappingException
- */
- public static function duplicateFieldMapping($entity, $fieldName)
- {
- return new self(sprintf(
- 'Property "%s" in "%s" was already declared, but it must be declared only once',
- $fieldName,
- $entity
- ));
- }
- /**
- * @param string $entity
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function duplicateAssociationMapping($entity, $fieldName)
- {
- return new self(sprintf(
- 'Property "%s" in "%s" was already declared, but it must be declared only once',
- $fieldName,
- $entity
- ));
- }
- /**
- * @param string $entity
- * @param string $queryName
- *
- * @return MappingException
- */
- public static function duplicateQueryMapping($entity, $queryName)
- {
- return new self(sprintf(
- 'Query named "%s" in "%s" was already declared, but it must be declared only once',
- $queryName,
- $entity
- ));
- }
- /**
- * @param string $entity
- * @param string $resultName
- *
- * @return MappingException
- */
- public static function duplicateResultSetMapping($entity, $resultName)
- {
- return new self(sprintf(
- 'Result set mapping named "%s" in "%s" was already declared, but it must be declared only once',
- $resultName,
- $entity
- ));
- }
- /**
- * @param string $entity
- *
- * @return MappingException
- */
- public static function singleIdNotAllowedOnCompositePrimaryKey($entity)
- {
- return new self('Single id is not allowed on composite primary key in entity ' . $entity);
- }
- /**
- * @param string $entity
- *
- * @return MappingException
- */
- public static function noIdDefined($entity)
- {
- return new self('No ID defined for entity ' . $entity);
- }
- /**
- * @param string $entity
- * @param string $fieldName
- * @param string $unsupportedType
- *
- * @return MappingException
- */
- public static function unsupportedOptimisticLockingType($entity, $fieldName, $unsupportedType)
- {
- return new self(sprintf(
- 'Locking type "%s" (specified in "%s", field "%s") is not supported by Doctrine.',
- $unsupportedType,
- $entity,
- $fieldName
- ));
- }
- /**
- * @param string|null $path
- *
- * @return MappingException
- */
- public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null)
- {
- if (! empty($path)) {
- $path = '[' . $path . ']';
- }
- return new self(
- 'File mapping drivers must have a valid directory path, ' .
- 'however the given path ' . $path . ' seems to be incorrect!'
- );
- }
- /**
- * Returns an exception that indicates that a class used in a discriminator map does not exist.
- * An example would be an outdated (maybe renamed) classname.
- *
- * @param string $className The class that could not be found
- * @param string $owningClass The class that declares the discriminator map.
- *
- * @return MappingException
- */
- public static function invalidClassInDiscriminatorMap($className, $owningClass)
- {
- return new self(sprintf(
- "Entity class '%s' used in the discriminator map of class '%s' " .
- 'does not exist.',
- $className,
- $owningClass
- ));
- }
- /**
- * @param string $className
- * @param string[] $entries
- * @param array<string,string> $map
- *
- * @return MappingException
- */
- public static function duplicateDiscriminatorEntry($className, array $entries, array $map)
- {
- return new self(
- 'The entries ' . implode(', ', $entries) . " in discriminator map of class '" . $className . "' is duplicated. " .
- 'If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. ' .
- 'The entries of the current map are: @DiscriminatorMap({' . implode(', ', array_map(
- static function ($a, $b) {
- return sprintf("'%s': '%s'", $a, $b);
- },
- array_keys($map),
- array_values($map)
- )) . '})'
- );
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function missingDiscriminatorMap($className)
- {
- return new self(sprintf(
- "Entity class '%s' is using inheritance but no discriminator map was defined.",
- $className
- ));
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function missingDiscriminatorColumn($className)
- {
- return new self(sprintf(
- "Entity class '%s' is using inheritance but no discriminator column was defined.",
- $className
- ));
- }
- /**
- * @param string $className
- * @param string $type
- *
- * @return MappingException
- */
- public static function invalidDiscriminatorColumnType($className, $type)
- {
- return new self(sprintf(
- "Discriminator column type on entity class '%s' is not allowed to be '%s'. 'string' or 'integer' type variables are suggested!",
- $className,
- $type
- ));
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function nameIsMandatoryForDiscriminatorColumns($className)
- {
- return new self(sprintf("Discriminator column name on entity class '%s' is not defined.", $className));
- }
- /**
- * @param string $className
- * @param string $fieldName
- *
- * @return MappingException
- */
- public static function cannotVersionIdField($className, $fieldName)
- {
- return new self(sprintf(
- "Setting Id field '%s' as versionable in entity class '%s' is not supported.",
- $fieldName,
- $className
- ));
- }
- /**
- * @param string $className
- * @param string $fieldName
- * @param string $type
- *
- * @return MappingException
- */
- public static function sqlConversionNotAllowedForIdentifiers($className, $fieldName, $type)
- {
- return new self(sprintf(
- "It is not possible to set id field '%s' to type '%s' in entity class '%s'. The type '%s' requires conversion SQL which is not allowed for identifiers.",
- $fieldName,
- $type,
- $className,
- $type
- ));
- }
- /**
- * @param string $className
- * @param string $columnName
- *
- * @return MappingException
- */
- public static function duplicateColumnName($className, $columnName)
- {
- return new self("Duplicate definition of column '" . $columnName . "' on entity '" . $className . "' in a field or discriminator column mapping.");
- }
- /**
- * @param string $className
- * @param string $field
- *
- * @return MappingException
- */
- public static function illegalToManyAssociationOnMappedSuperclass($className, $field)
- {
- return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '" . $className . '#' . $field . "'.");
- }
- /**
- * @param string $className
- * @param string $targetEntity
- * @param string $targetField
- *
- * @return MappingException
- */
- public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField)
- {
- return new self("It is not possible to map entity '" . $className . "' with a composite primary key " .
- "as part of the primary key of another entity '" . $targetEntity . '#' . $targetField . "'.");
- }
- /**
- * @param string $className
- * @param string $field
- *
- * @return MappingException
- */
- public static function noSingleAssociationJoinColumnFound($className, $field)
- {
- return new self(sprintf("'%s#%s' is not an association with a single join column.", $className, $field));
- }
- /**
- * @param string $className
- * @param string $column
- *
- * @return MappingException
- */
- public static function noFieldNameFoundForColumn($className, $column)
- {
- return new self(sprintf(
- "Cannot find a field on '%s' that is mapped to column '%s'. Either the " .
- 'field does not exist or an association exists but it has multiple join columns.',
- $className,
- $column
- ));
- }
- /**
- * @param string $className
- * @param string $field
- *
- * @return MappingException
- */
- public static function illegalOrphanRemovalOnIdentifierAssociation($className, $field)
- {
- return new self(sprintf(
- "The orphan removal option is not allowed on an association that is part of the identifier in '%s#%s'.",
- $className,
- $field
- ));
- }
- /**
- * @param string $className
- * @param string $field
- *
- * @return MappingException
- */
- public static function illegalOrphanRemoval($className, $field)
- {
- return new self('Orphan removal is only allowed on one-to-one and one-to-many ' .
- 'associations, but ' . $className . '#' . $field . ' is not.');
- }
- /**
- * @param string $className
- * @param string $field
- *
- * @return MappingException
- */
- public static function illegalInverseIdentifierAssociation($className, $field)
- {
- return new self(sprintf(
- "An inverse association is not allowed to be identifier in '%s#%s'.",
- $className,
- $field
- ));
- }
- /**
- * @param string $className
- * @param string $field
- *
- * @return MappingException
- */
- public static function illegalToManyIdentifierAssociation($className, $field)
- {
- return new self(sprintf(
- "Many-to-many or one-to-many associations are not allowed to be identifier in '%s#%s'.",
- $className,
- $field
- ));
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function noInheritanceOnMappedSuperClass($className)
- {
- return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'.");
- }
- /**
- * @param string $className
- * @param string $rootClassName
- *
- * @return MappingException
- */
- public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName)
- {
- return new self(
- "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " .
- "to be properly mapped in the inheritance hierarchy. Alternatively you can make '" . $className . "' an abstract class " .
- 'to avoid this exception from occurring.'
- );
- }
- /**
- * @param string $className
- * @param string $methodName
- *
- * @return MappingException
- */
- public static function lifecycleCallbackMethodNotFound($className, $methodName)
- {
- return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback.");
- }
- /**
- * @param string $listenerName
- * @param string $className
- *
- * @return MappingException
- */
- public static function entityListenerClassNotFound($listenerName, $className)
- {
- return new self(sprintf('Entity Listener "%s" declared on "%s" not found.', $listenerName, $className));
- }
- /**
- * @param string $listenerName
- * @param string $methodName
- * @param string $className
- *
- * @return MappingException
- */
- public static function entityListenerMethodNotFound($listenerName, $methodName, $className)
- {
- return new self(sprintf('Entity Listener "%s" declared on "%s" has no method "%s".', $listenerName, $className, $methodName));
- }
- /**
- * @param string $listenerName
- * @param string $methodName
- * @param string $className
- *
- * @return MappingException
- */
- public static function duplicateEntityListener($listenerName, $methodName, $className)
- {
- return new self(sprintf('Entity Listener "%s#%s()" in "%s" was already declared, but it must be declared only once.', $listenerName, $methodName, $className));
- }
- /**
- * @param string $className
- * @param string $annotation
- *
- * @return MappingException
- */
- public static function invalidFetchMode($className, $annotation)
- {
- return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'");
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function compositeKeyAssignedIdGeneratorRequired($className)
- {
- return new self("Entity '" . $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported.");
- }
- /**
- * @param string $targetEntity
- * @param string $sourceEntity
- * @param string $associationName
- *
- * @return MappingException
- */
- public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName)
- {
- return new self('The target-entity ' . $targetEntity . " cannot be found in '" . $sourceEntity . '#' . $associationName . "'.");
- }
- /**
- * @param string[] $cascades
- * @param string $className
- * @param string $propertyName
- *
- * @return MappingException
- */
- public static function invalidCascadeOption(array $cascades, $className, $propertyName)
- {
- $cascades = implode(', ', array_map(static function ($e) {
- return "'" . $e . "'";
- }, $cascades));
- return new self(sprintf(
- "You have specified invalid cascade options for %s::$%s: %s; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'",
- $className,
- $propertyName,
- $cascades
- ));
- }
- /**
- * @param string $className
- *
- * @return MappingException
- */
- public static function missingSequenceName($className)
- {
- return new self(
- sprintf('Missing "sequenceName" attribute for sequence id generator definition on class "%s".', $className)
- );
- }
- /**
- * @param string $className
- * @param string $propertyName
- *
- * @return MappingException
- */
- public static function infiniteEmbeddableNesting($className, $propertyName)
- {
- return new self(
- sprintf(
- 'Infinite nesting detected for embedded property %s::%s. ' .
- 'You cannot embed an embeddable from the same type inside an embeddable.',
- $className,
- $propertyName
- )
- );
- }
- /**
- * @return MappingException
- */
- public static function illegalOverrideOfInheritedProperty($className, $propertyName)
- {
- return new self(
- sprintf(
- 'Override for %s::%s is only allowed for attributes/associations ' .
- 'declared on a mapped superclass or a trait.',
- $className,
- $propertyName
- )
- );
- }
- }
|