PHP Class Doctrine\OXM\Mapping\ClassMetadata

Once populated, ClassMetadata instances are usually cached in a serialized form. IMPORTANT NOTE: The fields of this class are only public for 2 reasons: 1) To allow fast READ access. 2) To drastically reduce the size of a serialized instance (private/protected members get the whole class name, namespace inclusive, prepended to every property in the serialized representation).
Since: 2.0
Author: Jonathan H. Wage ([email protected])
Author: Richard Fullmer ([email protected])
Inheritance: extends ClassMetadataInfo
Afficher le fichier Open project: doctrine/oxm Class Usage Examples

Méthodes publiques

Свойство Type Description
$reflFields array The ReflectionProperty instances of the mapped class.

Méthodes publiques

Méthode Description
__construct ( string $entityName ) Initializes a new ClassMetadata instance that will hold the object-document mapping metadata of the class with the given name.
__sleep ( ) : array Determines which fields get serialized.
__wakeup ( ) : void Restores some state that can not be serialized/unserialized.
getFieldValue ( object $entity, string $fieldName ) Gets the specified field's value off the given entity.
getIdentifierValue ( object $xmlEntity ) : string Gets the document identifier.
getReflectionProperties ( ) : ReflectionProperty[] Gets the ReflectionPropertys of the mapped class.
getReflectionProperty ( string $name ) : ReflectionProperty Gets a ReflectionProperty for a specific field of the mapped class.
mapField ( array $mapping ) Map a field.
newInstance ( ) : object Creates a new instance of the mapped class, without invoking the constructor.
setFieldValue ( object $entity, string $fieldName, mixed $value ) Sets the specified field to the specified value on the given entity.
setIdentifierValue ( object $xmlEntity, array $id ) Populates the entity identifier of an entity.

Method Details

__construct() public méthode

Initializes a new ClassMetadata instance that will hold the object-document mapping metadata of the class with the given name.
public __construct ( string $entityName )
$entityName string The name of the document class the new instance is used for.

__sleep() public méthode

It is only serialized what is necessary for best unserialization performance. That means any metadata properties that are not set or empty or simply have their default value are NOT serialized. Parts that are also NOT serialized because they can not be properly unserialized: - reflClass (ReflectionClass) - reflFields (ReflectionProperty array)
public __sleep ( ) : array
Résultat array The names of all the fields that should be serialized.

__wakeup() public méthode

Restores some state that can not be serialized/unserialized.
public __wakeup ( ) : void
Résultat void

getFieldValue() public méthode

Gets the specified field's value off the given entity.
public getFieldValue ( object $entity, string $fieldName )
$entity object
$fieldName string

getIdentifierValue() public méthode

Gets the document identifier.
public getIdentifierValue ( object $xmlEntity ) : string
$xmlEntity object
Résultat string $id

getReflectionProperties() public méthode

Gets the ReflectionPropertys of the mapped class.
public getReflectionProperties ( ) : ReflectionProperty[]
Résultat ReflectionProperty[] An array of ReflectionProperty instances.

getReflectionProperty() public méthode

Gets a ReflectionProperty for a specific field of the mapped class.
public getReflectionProperty ( string $name ) : ReflectionProperty
$name string
Résultat ReflectionProperty

mapField() public méthode

Map a field.
public mapField ( array $mapping )
$mapping array The mapping information.

newInstance() public méthode

Creates a new instance of the mapped class, without invoking the constructor.
public newInstance ( ) : object
Résultat object

setFieldValue() public méthode

Sets the specified field to the specified value on the given entity.
public setFieldValue ( object $entity, string $fieldName, mixed $value )
$entity object
$fieldName string
$value mixed

setIdentifierValue() public méthode

Populates the entity identifier of an entity.
public setIdentifierValue ( object $xmlEntity, array $id )
$xmlEntity object
$id array

Property Details

$reflFields public_oe property

The ReflectionProperty instances of the mapped class.
public array $reflFields
Résultat array