PHP Class Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory

This class was abstracted from the ORM ClassMetadataFactory
Since: 2.2
Author: Benjamin Eberlei ([email protected])
Author: Guilherme Blanco ([email protected])
Author: Jonathan Wage ([email protected])
Author: Roman Borschel ([email protected])
Inheritance: implements Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
Afficher le fichier Open project: doctrine/common Class Usage Examples

Protected Properties

Свойство Type Description
$cacheSalt string Salt used by specific Object Manager implementation.
$initialized boolean

Méthodes publiques

Méthode Description
getAllMetadata ( ) : array Forces the factory to load the metadata of all classes known to the underlying mapping driver.
getCacheDriver ( ) : Doctrine\Common\Cache\Cache | null Gets the cache driver used by the factory to cache ClassMetadata instances.
getLoadedMetadata ( ) : Doctrine\Common\Persistence\Mapping\ClassMetadata[] Returns an array of all the loaded metadata currently in memory.
getMetadataFor ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata Gets the class metadata descriptor for a class.
getReflectionService ( ) : Doctrine\Common\Persistence\Mapping\ReflectionService Gets the reflection service associated with this metadata factory.
hasMetadataFor ( string $className ) : boolean Checks whether the factory has the metadata for a class loaded already.
isTransient ( $class ) {@inheritDoc}
setCacheDriver ( Doctrine\Common\Cache\Cache $cacheDriver = null ) : void Sets the cache driver used by the factory to cache ClassMetadata instances.
setMetadataFor ( string $className, Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : void Sets the metadata descriptor for a specific class.
setReflectionService ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflectionService ) : void Sets the reflectionService.

Méthodes protégées

Méthode Description
doLoadMetadata ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, Doctrine\Common\Persistence\Mapping\ClassMetadata | null $parent, boolean $rootEntityFound, array $nonSuperclassParents ) : void Actually loads the metadata from the underlying metadata.
getDriver ( ) : Doctrine\Common\Persistence\Mapping\Driver\MappingDriver Returns the mapping driver implementation.
getFqcnFromAlias ( string $namespaceAlias, string $simpleClassName ) : string Gets the fully qualified class-name from the namespace alias.
getParentClasses ( string $name ) : array Gets an array of parent classes for the given entity class.
initialize ( ) : void Lazy initialization of this stuff, especially the metadata driver, since these are not needed at all when a metadata cache is active.
initializeReflection ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void Initializes Reflection after ClassMetadata was constructed.
isEntity ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : boolean Checks whether the class metadata is an entity.
loadMetadata ( string $name ) : array Loads the metadata of the class in question and all it's ancestors whose metadata is still not loaded.
newClassMetadataInstance ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata Creates a new ClassMetadata instance for the given class name.
onNotFoundMetadata ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata | null Provides a fallback hook for loading metadata when loading failed due to reflection/mapping exceptions
wakeupReflection ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void Wakes up reflection after ClassMetadata gets unserialized from cache.

Method Details

doLoadMetadata() abstract protected méthode

Actually loads the metadata from the underlying metadata.
abstract protected doLoadMetadata ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, Doctrine\Common\Persistence\Mapping\ClassMetadata | null $parent, boolean $rootEntityFound, array $nonSuperclassParents ) : void
$class Doctrine\Common\Persistence\Mapping\ClassMetadata
$parent Doctrine\Common\Persistence\Mapping\ClassMetadata | null
$rootEntityFound boolean
$nonSuperclassParents array All parent class names that are not marked as mapped superclasses.
Résultat void

getAllMetadata() public méthode

Forces the factory to load the metadata of all classes known to the underlying mapping driver.
public getAllMetadata ( ) : array
Résultat array The ClassMetadata instances of all mapped classes.

getCacheDriver() public méthode

Gets the cache driver used by the factory to cache ClassMetadata instances.
public getCacheDriver ( ) : Doctrine\Common\Cache\Cache | null
Résultat Doctrine\Common\Cache\Cache | null

getDriver() abstract protected méthode

Returns the mapping driver implementation.
abstract protected getDriver ( ) : Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
Résultat Doctrine\Common\Persistence\Mapping\Driver\MappingDriver

getFqcnFromAlias() abstract protected méthode

Gets the fully qualified class-name from the namespace alias.
abstract protected getFqcnFromAlias ( string $namespaceAlias, string $simpleClassName ) : string
$namespaceAlias string
$simpleClassName string
Résultat string

getLoadedMetadata() public méthode

Returns an array of all the loaded metadata currently in memory.
public getLoadedMetadata ( ) : Doctrine\Common\Persistence\Mapping\ClassMetadata[]
Résultat Doctrine\Common\Persistence\Mapping\ClassMetadata[]

getMetadataFor() public méthode

Gets the class metadata descriptor for a class.
public getMetadataFor ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata
$className string The name of the class.
Résultat Doctrine\Common\Persistence\Mapping\ClassMetadata

getParentClasses() protected méthode

Gets an array of parent classes for the given entity class.
protected getParentClasses ( string $name ) : array
$name string
Résultat array

getReflectionService() public méthode

Gets the reflection service associated with this metadata factory.
public getReflectionService ( ) : Doctrine\Common\Persistence\Mapping\ReflectionService
Résultat Doctrine\Common\Persistence\Mapping\ReflectionService

hasMetadataFor() public méthode

Checks whether the factory has the metadata for a class loaded already.
public hasMetadataFor ( string $className ) : boolean
$className string
Résultat boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.

initialize() abstract protected méthode

Lazy initialization of this stuff, especially the metadata driver, since these are not needed at all when a metadata cache is active.
abstract protected initialize ( ) : void
Résultat void

initializeReflection() abstract protected méthode

Initializes Reflection after ClassMetadata was constructed.
abstract protected initializeReflection ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void
$class Doctrine\Common\Persistence\Mapping\ClassMetadata
$reflService Doctrine\Common\Persistence\Mapping\ReflectionService
Résultat void

isEntity() abstract protected méthode

This method should return false for mapped superclasses or embedded classes.
abstract protected isEntity ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : boolean
$class Doctrine\Common\Persistence\Mapping\ClassMetadata
Résultat boolean

isTransient() public méthode

{@inheritDoc}
public isTransient ( $class )

loadMetadata() protected méthode

Important: The class $name does not necesarily exist at this point here. Scenarios in a code-generation setup might have access to XML/YAML Mapping files without the actual PHP code existing here. That is why the {@see \Doctrine\Common\Persistence\Mapping\ReflectionService} interface should be used for reflection.
protected loadMetadata ( string $name ) : array
$name string The name of the class for which the metadata should get loaded.
Résultat array

newClassMetadataInstance() abstract protected méthode

Creates a new ClassMetadata instance for the given class name.
abstract protected newClassMetadataInstance ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata
$className string
Résultat Doctrine\Common\Persistence\Mapping\ClassMetadata

onNotFoundMetadata() protected méthode

Override this method to implement a fallback strategy for failed metadata loading
protected onNotFoundMetadata ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata | null
$className string
Résultat Doctrine\Common\Persistence\Mapping\ClassMetadata | null

setCacheDriver() public méthode

Sets the cache driver used by the factory to cache ClassMetadata instances.
public setCacheDriver ( Doctrine\Common\Cache\Cache $cacheDriver = null ) : void
$cacheDriver Doctrine\Common\Cache\Cache
Résultat void

setMetadataFor() public méthode

NOTE: This is only useful in very special cases, like when generating proxy classes.
public setMetadataFor ( string $className, Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : void
$className string
$class Doctrine\Common\Persistence\Mapping\ClassMetadata
Résultat void

setReflectionService() public méthode

Sets the reflectionService.
public setReflectionService ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflectionService ) : void
$reflectionService Doctrine\Common\Persistence\Mapping\ReflectionService
Résultat void

wakeupReflection() abstract protected méthode

Wakes up reflection after ClassMetadata gets unserialized from cache.
abstract protected wakeupReflection ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void
$class Doctrine\Common\Persistence\Mapping\ClassMetadata
$reflService Doctrine\Common\Persistence\Mapping\ReflectionService
Résultat void

Property Details

$cacheSalt protected_oe property

Salt used by specific Object Manager implementation.
protected string $cacheSalt
Résultat string

$initialized protected_oe property

protected bool $initialized
Résultat boolean