<out T is object>implements |
ClassMetadata<T> |
|---|
A ClassMetadata instance holds all the object-relational mapping metadata of an entity and its associations.
Once populated, ClassMetadata instances are usually cached in a serialized form.
IMPORTANT NOTE:
The fields of this class are only public for 2 reasons:
| Methods | ||
|---|---|---|
public
|
__construct(
class-string<T> $entityName,
?NamingStrategy $namingStrategy = null,
?TypedFieldMapper $typedFieldMapper = null,
)
|
# |
public
|
getReflectionProperties(): ReflectionProperty[]|null[]
|
# |
public
|
getReflectionProperty(string $name): ReflectionProperty
|
# |
public
|
getSingleIdReflectionProperty(): ReflectionProperty
|
# |
public
|
getIdentifierValues(object $entity): array<string, mixed>
|
# |
public
|
setIdentifierValues(object $entity, array<string, mixed> $id): void
|
# |
public
|
setFieldValue(object $entity, string $field, mixed $value): void
|
# |
public
|
getFieldValue(object $entity, string $field): mixed
|
# |
public
|
__toString(): string
|
# |
public
|
__sleep(): string[]
|
# |
public
|
newInstance(): object
|
# |
public
|
wakeupReflection(ReflectionService $reflService): void
|
# |
public
|
initializeReflection(ReflectionService $reflService): void
|
# |
public
|
validateIdentifier(): void
|
# |
public
|
validateAssociations(): void
|
# |
public
|
validateLifecycleCallbacks(ReflectionService $reflService): void
|
# |
public
|
getReflectionClass()
|
# |
public
|
enableCache(array{usage?: mixed, region?: mixed} $cache): void
|
# |
public
|
enableAssociationCache(string $fieldName, array{usage?: int, region?: string} $cache): void
|
# |
public
|
getAssociationCacheDefaults(string $fieldName, array{usage?: (int|null), region?: (string|null)} $cache): int[]|string[]
|
# |
public
|
setChangeTrackingPolicy(int $policy): void
|
# |
public
|
isChangeTrackingDeferredExplicit(): bool
|
# |
public
|
isChangeTrackingDeferredImplicit(): bool
|
# |
public
|
isChangeTrackingNotify(): bool
|
# |
public
|
isIdentifier(string $fieldName): bool
|
# |
public
|
isUniqueField(string $fieldName): bool
|
# |
public
|
isNullable(string $fieldName): bool
|
# |
public
|
getColumnName(string $fieldName): string
|
# |
public
|
getFieldMapping(string $fieldName): mixed[]
|
# |
public
|
getAssociationMapping(string $fieldName): mixed[]
|
# |
public
|
getAssociationMappings()
|
# |
public
|
getFieldName(string $columnName): string
|
# |
public
|
getNamedQuery(string $queryName): string
|
# |
public
|
getNamedQueries(): mixed[][]
|
# |
public
|
getNamedNativeQuery(string $queryName): mixed[]
|
# |
public
|
getNamedNativeQueries()
|
# |
public
|
getSqlResultSetMapping(string $name): mixed[]
|
# |
public
|
getSqlResultSetMappings(): mixed[]
|
# |
private
|
isTypedProperty(string $name): bool
|
# |
private
|
validateAndCompleteTypedFieldMapping(
array{fieldName: string, type?: string} $mapping,
): array{fieldName: string, enumType?: class-string<BackedEnum>, type?: string}
|
# |
private
|
validateAndCompleteTypedAssociationMapping(
array{type: (self::ONE_TO_ONE|self::MANY_TO_ONE|self::ONE_TO_MANY|self::MANY_TO_MANY), fieldName: string, targetEntity?: class-string} $mapping,
): mixed[]
|
# |
protected
|
validateAndCompleteFieldMapping(
array{fieldName?: string, columnName?: string, id?: bool, generated?: int, enumType?: class-string} $mapping,
): FieldMapping
|
# |
protected
|
_validateAndCompleteAssociationMapping(array<string, mixed> $mapping): mixed[]
|
# |
protected
|
_validateAndCompleteOneToOneMapping(array<string, mixed> $mapping): mixed[]
|
# |
protected
|
_validateAndCompleteOneToManyMapping(array<string, mixed> $mapping): mixed[]
|
# |
protected
|
_validateAndCompleteManyToManyMapping(array<string, mixed> $mapping): mixed[]
|
# |
public
|
getIdentifierFieldNames()
|
# |
public
|
getSingleIdentifierFieldName(): string
|
# |
public
|
getSingleIdentifierColumnName(): string
|
# |
public
|
setIdentifier(list<mixed> $identifier): void
|
# |
public
|
getIdentifier()
|
# |
public
|
hasField($fieldName)
|
# |
public
|
getColumnNames(list<string>|null $fieldNames = null): mixed[]
|
# |
public
|
getIdentifierColumnNames()
|
# |
public
|
setIdGeneratorType(self::GENERATOR_TYPE_* $generatorType): void
|
# |
public
|
usesIdGenerator(): bool
|
# |
public
|
isInheritanceTypeNone(): bool
|
# |
public
|
isInheritanceTypeJoined(): bool
|
# |
public
|
isInheritanceTypeSingleTable(): bool
|
# |
public
|
isInheritanceTypeTablePerClass(): bool
|
# |
public
|
isIdGeneratorIdentity(): bool
|
# |
public
|
isIdGeneratorSequence(): bool
|
# |
public
|
isIdGeneratorTable(): false
|
# |
public
|
isIdentifierNatural(): bool
|
# |
public
|
isIdentifierUuid(): bool
|
# |
public
|
getTypeOfField(string $fieldName): string|null
|
# |
public
|
getTypeOfColumn(string $columnName): string|null
|
# |
public
|
getTableName(): string
|
# |
public
|
getSchemaName(): string|null
|
# |
public
|
getTemporaryIdTableName(): string
|
# |
public
|
setSubclasses(list<string> $subclasses): void
|
# |
public
|
setParentClasses(list<class-string> $classNames): void
|
# |
public
|
setInheritanceType(self::INHERITANCE_TYPE_* $type): void
|
# |
public
|
setAssociationOverride(string $fieldName, array<string, mixed> $overrideMapping): void
|
# |
public
|
setAttributeOverride(string $fieldName, array<string, mixed> $overrideMapping): void
|
# |
public
|
isInheritedField(string $fieldName): bool
|
# |
public
|
isRootEntity(): bool
|
# |
public
|
isInheritedAssociation(string $fieldName): bool
|
# |
public
|
isInheritedEmbeddedClass(string $fieldName): bool
|
# |
public
|
setTableName(string $tableName): void
|
# |
public
|
setPrimaryTable(array<string, mixed> $table): void
|
# |
private
|
isInheritanceType(int $type): bool
|
# |
public
|
mapField(array<string, mixed> $mapping): void
|
# |
public
|
addInheritedAssociationMapping(AssociationMapping $mapping): void
|
# |
public
|
addInheritedFieldMapping(FieldMapping $fieldMapping): void
|
# |
public
|
addNamedQuery(array<string, mixed> $queryMapping): void
|
# |
public
|
addNamedNativeQuery(array<string, mixed> $queryMapping): void
|
# |
public
|
addSqlResultSetMapping(array<string, mixed> $resultMapping): void
|
# |
public
|
mapOneToOne(array<string, mixed> $mapping): void
|
# |
public
|
mapOneToMany(array<string, mixed> $mapping): void
|
# |
public
|
mapManyToOne(array<string, mixed> $mapping): void
|
# |
public
|
mapManyToMany(array<string, mixed> $mapping): void
|
# |
protected
|
_storeAssociationMapping(AssociationMapping $assocMapping): void
|
# |
public
|
setCustomRepositoryClass(class-string<EntityRepository>|null $repositoryClassName): void
|
# |
public
|
invokeLifecycleCallbacks(string $lifecycleEvent, object $entity): void
|
# |
public
|
hasLifecycleCallbacks(string $lifecycleEvent): bool
|
# |
public
|
getLifecycleCallbacks(string $event): string[]
|
# |
public
|
addLifecycleCallback(string $callback, string $event): void
|
# |
public
|
setLifecycleCallbacks(array<string, list<string>> $callbacks): void
|
# |
public
|
addEntityListener(string $eventName, string $class, string $method): void
|
# |
public
|
setDiscriminatorColumn(
array{name: (string|null), fieldName?: string, type?: string, length?: int, columnDefinition?: (string|null), enumType?: (class-string<BackedEnum>|null), options?: array<string, mixed>}|null $columnDef,
): void
|
# |
final
public
|
getDiscriminatorColumn(): array<string, mixed>
|
# |
public
|
setDiscriminatorMap(array<int|string, string> $map): void
|
# |
public
|
addDiscriminatorMapClass(int|string $name, string $className): void
|
# |
public
|
addSubClasses(array<class-string> $classes): void
|
# |
public
|
addSubClass(string $className): void
|
# |
public
|
hasNamedQuery(string $queryName): bool
|
# |
public
|
hasNamedNativeQuery(string $queryName): bool
|
# |
public
|
hasSqlResultSetMapping(string $name): bool
|
# |
public
|
hasAssociation($fieldName)
|
# |
public
|
isSingleValuedAssociation($fieldName)
|
# |
public
|
isCollectionValuedAssociation($fieldName)
|
# |
public
|
isAssociationWithSingleJoinColumn(string $fieldName): bool
|
# |
public
|
getSingleAssociationJoinColumnName(string $fieldName): string
|
# |
public
|
getSingleAssociationReferencedJoinColumnName(string $fieldName): string
|
# |
public
|
getFieldForColumn(string $columnName): string
|
# |
public
|
setIdGenerator(AbstractIdGenerator $generator): void
|
# |
public
|
setCustomGeneratorDefinition(array<string, string|null> $definition): void
|
# |
public
|
setSequenceGeneratorDefinition(
array{sequenceName?: string, allocationSize?: (int|string), initialValue?: (int|string), quoted?: mixed} $definition,
): void
|
# |
public
|
setVersionMapping(array<string, mixed> &$mapping): void
|
# |
public
|
setVersioned(bool $bool): void
|
# |
public
|
setVersionField(string|null $versionField): void
|
# |
public
|
markReadOnly(): void
|
# |
public
|
getFieldNames()
|
# |
public
|
getAssociationNames()
|
# |
public
|
getAssociationTargetClass(string $assocName): string
|
# |
public
|
getName()
|
# |
public
|
getQuotedIdentifierColumnNames(AbstractPlatform $platform): string[]
|
# |
public
|
getQuotedColumnName(string $field, AbstractPlatform $platform): string
|
# |
public
|
getQuotedTableName(AbstractPlatform $platform): string
|
# |
public
|
getQuotedJoinTableName(mixed[] $assoc, AbstractPlatform $platform): string
|
# |
public
|
isAssociationInverseSide($fieldName)
|
# |
public
|
getAssociationMappedByTargetField($fieldName)
|
# |
public
|
getAssociationsByTargetClass(string $targetClass): mixed[][]
|
# |
public
|
fullyQualifiedClassName(string|null $className): string|null
|
# |
public
|
getMetadataValue(string $name): mixed
|
# |
public
|
mapEmbedded(array<string, mixed> $mapping): void
|
# |
public
|
inlineEmbeddable(string $property, ClassMetadataInfo $embeddable): void
|
# |
private
|
assertFieldNotMapped(string $fieldName): void
|
# |
public
|
getSequenceName(AbstractPlatform $platform): string
|
# |
public
|
getSequencePrefix(AbstractPlatform $platform): string
|
# |
private
|
assertMappingOrderBy(AssociationMapping $mapping): void
|
# |
private
|
getAccessibleProperty(ReflectionService $reflService, class-string $class, string $field): ?ReflectionProperty
|
# |
| Constants | ||
|---|---|---|
public
|
INHERITANCE_TYPE_NONE = 1
|
# |
public
|
INHERITANCE_TYPE_JOINED = 2
|
# |
public
|
INHERITANCE_TYPE_SINGLE_TABLE = 3
|
# |
public
|
INHERITANCE_TYPE_TABLE_PER_CLASS = 4
|
# |
public
|
GENERATOR_TYPE_AUTO = 1
|
# |
public
|
GENERATOR_TYPE_SEQUENCE = 2
|
# |
public
|
GENERATOR_TYPE_TABLE = 3
|
# |
public
|
GENERATOR_TYPE_IDENTITY = 4
|
# |
public
|
GENERATOR_TYPE_NONE = 5
|
# |
public
|
GENERATOR_TYPE_UUID = 6
|
# |
public
|
GENERATOR_TYPE_CUSTOM = 7
|
# |
public
|
CHANGETRACKING_DEFERRED_IMPLICIT = 1
|
# |
public
|
CHANGETRACKING_DEFERRED_EXPLICIT = 2
|
# |
public
|
CHANGETRACKING_NOTIFY = 3
|
# |
public
|
FETCH_LAZY = 2
|
# |
public
|
FETCH_EAGER = 3
|
# |
public
|
FETCH_EXTRA_LAZY = 4
|
# |
public
|
ONE_TO_ONE = 1
|
# |
public
|
MANY_TO_ONE = 2
|
# |
public
|
ONE_TO_MANY = 4
|
# |
public
|
MANY_TO_MANY = 8
|
# |
public
|
TO_ONE = 3
|
# |
public
|
TO_MANY = 12
|
# |
public
|
CACHE_USAGE_READ_ONLY = 1
|
# |
public
|
CACHE_USAGE_NONSTRICT_READ_WRITE = 2
|
# |
public
|
CACHE_USAGE_READ_WRITE = 3
|
# |
public
|
GENERATED_NEVER = 0
|
# |
public
|
GENERATED_INSERT = 1
|
# |
public
|
GENERATED_ALWAYS = 2
|
# |
| Properties | |||
|---|---|---|---|
public
|
string
|
$name
|
# |
public
|
string
|
$namespace
|
# |
public
|
string
|
$rootEntityName
|
# |
public
|
array<string, string>|null
|
$customGeneratorDefinition
|
# |
public
|
string|null
|
$customRepositoryClassName
|
# |
public
|
bool
|
$isMappedSuperclass = false
|
# |
public
|
bool
|
$isEmbeddedClass = false
|
# |
public
|
|
$parentClasses = []
|
# |
public
|
|
$subClasses = []
|
# |
public
|
|
$embeddedClasses = []
|
# |
public
|
|
$namedQueries = []
|
# |
public
|
|
$namedNativeQueries = []
|
# |
public
|
|
$sqlResultSetMappings = []
|
# |
public
|
|
$identifier = []
|
# |
public
|
int
|
$inheritanceType = self::INHERITANCE_TYPE_NONE
|
# |
public
|
int
|
$generatorType = self::GENERATOR_TYPE_NONE
|
# |
public
|
mixed[]
|
$fieldMappings = []
|
# |
public
|
|
$fieldNames = []
|
# |
public
|
mixed[]
|
$columnNames = []
|
# |
public
|
mixed
|
$discriminatorValue
|
# |
public
|
array<int|string, string>
|
$discriminatorMap = []
|
# |
public
|
array<string, mixed>
|
$discriminatorColumn
|
# |
public
|
mixed[]
|
$table
|
# |
public
|
|
$lifecycleCallbacks = []
|
# |
public
|
|
$entityListeners = []
|
# |
public
|
|
$associationMappings = []
|
# |
public
|
bool
|
$isIdentifierComposite = false
|
# |
public
|
bool
|
$containsForeignIdentifier = false
|
# |
public
|
bool
|
$containsEnumIdentifier = false
|
# |
public
|
AbstractIdGenerator
|
$idGenerator
|
# |
public
|
array<string, mixed>|null
|
$sequenceGeneratorDefinition
|
# |
public
|
array<string, mixed>
|
$tableGeneratorDefinition
|
# |
public
|
int
|
$changeTrackingPolicy = self::CHANGETRACKING_DEFERRED_IMPLICIT
|
# |
public
|
bool
|
$requiresFetchAfterChange = false
|
# |
public
|
bool
|
$isVersioned = false
|
# |
public
|
string|null
|
$versionField
|
# |
public
|
mixed[]|null
|
$cache
|
# |
public
|
ReflectionClass|null
|
$reflClass
|
# |
public
|
bool
|
$isReadOnly = false
|
# |
protected
|
NamingStrategy
|
$namingStrategy
|
# |
public
|
array<string, ReflectionProperty|null>
|
$reflFields = []
|
# |
private
|
InstantiatorInterface|null
|
$instantiator
|
# |
private
|
TypedFieldMapper
|
$typedFieldMapper
|
# |