PHP Class Doctrine\Search\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 (public/protected members get the whole class name, namespace inclusive, prepended to every property in the serialized representation).
Since: 1.0
Author: Mike Lohmann ([email protected])
Inheritance: implements Doctrine\Common\Persistence\Mapping\ClassMetadata
Afficher le fichier Open project: doctrine/search Class Usage Examples

Méthodes publiques

Свойство Type Description
$boost float
$className string
$fieldMappings array | Doctrine\Search\Mapping\Annotations\ElasticField[] The ReflectionProperty instances of the mapped class.
$identifier string The field name of the identifier
$index string
$numberOfReplicas integer
$numberOfShards integer
$parameters array The ReflectionProperty parameters of the mapped class.
$parent string
$reflClass ReflectionClass The ReflectionClass instance of the mapped class.
$reflFields ReflectionClass The ReflectionClass instance of the mapped class.
$rootMappings array | Doctrine\Search\Mapping\Annotations\ElasticRoot[] Additional root annotations of the mapped class.
$source boolean
$timeToLive integer
$type string
$value integer

Méthodes publiques

Méthode Description
__construct ( $documentName )
__sleep ( ) : array Determines which fields get serialized.
getAssociationMappedByTargetField ( $assocName )
getAssociationNames ( ) : array Currently not necessary but needed by Interface
getAssociationTargetClass ( string $assocName ) : string Currently not necessary but needed by Interface
getFieldNames ( ) : array A numerically indexed list of field names of this persistent class.
getIdentifier ( ) : array Gets the mapped identifier field name.
getIdentifierFieldNames ( ) : array Returns an array of identifier field names numerically indexed.
getIdentifierValues ( object $object ) : array Return the identifier of this object as an array with field name as key.
getName ( ) : string Get fully-qualified class name of this persistent class.
getReflectionClass ( ) : ReflectionClass Gets the ReflectionClass instance for this mapped class.
getTypeOfField ( string $fieldName ) : string Returns a type name of this field.
hasAssociation ( string $fieldName ) : boolean Checks if the given field is a mapped association for this class.
hasField ( string $fieldName ) : boolean Checks if the given field is a mapped property for this class.
initializeReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name.
isAssociationInverseSide ( $assocName )
isCollectionValuedAssociation ( string $fieldName ) : boolean Checks if the given field is a mapped collection valued association for this class.
isIdentifier ( string $fieldName ) : boolean Checks if the given field name is a mapped identifier for this class.
isSingleValuedAssociation ( string $fieldName ) : boolean Checks if the given field is a mapped single valued association for this class.
mapField ( array $mapping ) : void Adds a mapped field to the class.
mapParameter ( array $mapping ) : void Adds a mapped parameter to the class.
mapRoot ( array $mapping = [] ) Adds a root mapping to the class.
setIdentifier ( mixed $identifier ) INTERNAL: Sets the mapped identifier key field of this class.
wakeupReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void Restores some state that can not be serialized/unserialized.

Method Details

__construct() public méthode

public __construct ( $documentName )

__sleep() public méthode

It is only serialized what is necessary for best unserialization performance. 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.

getAssociationMappedByTargetField() public méthode

public getAssociationMappedByTargetField ( $assocName )

getAssociationNames() public méthode

Currently not necessary but needed by Interface
public getAssociationNames ( ) : array
Résultat array

getAssociationTargetClass() public méthode

Currently not necessary but needed by Interface
public getAssociationTargetClass ( string $assocName ) : string
$assocName string
Résultat string

getFieldNames() public méthode

This array includes identifier fields if present on this class.
public getFieldNames ( ) : array
Résultat array

getIdentifier() public méthode

The returned structure is an array of the identifier field names.
public getIdentifier ( ) : array
Résultat array

getIdentifierFieldNames() public méthode

Returns an array of identifier field names numerically indexed.
public getIdentifierFieldNames ( ) : array
Résultat array

getIdentifierValues() public méthode

Has to return an empty array if no identifier isset.
public getIdentifierValues ( object $object ) : array
$object object
Résultat array

getName() public méthode

Get fully-qualified class name of this persistent class.
public getName ( ) : string
Résultat string

getReflectionClass() public méthode

Gets the ReflectionClass instance for this mapped class.
public getReflectionClass ( ) : ReflectionClass
Résultat ReflectionClass

getTypeOfField() public méthode

This type names can be implementation specific but should at least include the php types: integer, string, boolean, float/double, datetime.
public getTypeOfField ( string $fieldName ) : string
$fieldName string
Résultat string

hasAssociation() public méthode

Checks if the given field is a mapped association for this class.
public hasAssociation ( string $fieldName ) : boolean
$fieldName string
Résultat boolean

hasField() public méthode

Checks if the given field is a mapped property for this class.
public hasField ( string $fieldName ) : boolean
$fieldName string
Résultat boolean

initializeReflection() public méthode

Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name.
public initializeReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void
$reflService Doctrine\Common\Persistence\Mapping\ReflectionService The reflection service.
Résultat void

isAssociationInverseSide() public méthode

public isAssociationInverseSide ( $assocName )

isCollectionValuedAssociation() public méthode

Checks if the given field is a mapped collection valued association for this class.
public isCollectionValuedAssociation ( string $fieldName ) : boolean
$fieldName string
Résultat boolean

isIdentifier() public méthode

Checks if the given field name is a mapped identifier for this class.
public isIdentifier ( string $fieldName ) : boolean
$fieldName string
Résultat boolean

isSingleValuedAssociation() public méthode

Checks if the given field is a mapped single valued association for this class.
public isSingleValuedAssociation ( string $fieldName ) : boolean
$fieldName string
Résultat boolean

mapField() public méthode

Adds a mapped field to the class.
public mapField ( array $mapping ) : void
$mapping array The field mapping.
Résultat void

mapParameter() public méthode

Adds a mapped parameter to the class.
public mapParameter ( array $mapping ) : void
$mapping array The parameter mapping.
Résultat void

mapRoot() public méthode

Adds a root mapping to the class.
public mapRoot ( array $mapping = [] )
$mapping array

setIdentifier() public méthode

Mainly used by the ClassMetadataFactory to assign inherited identifiers.
public setIdentifier ( mixed $identifier )
$identifier mixed

wakeupReflection() public méthode

Restores some state that can not be serialized/unserialized.
public wakeupReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void
$reflService Doctrine\Common\Persistence\Mapping\ReflectionService
Résultat void

Property Details

$boost public_oe property

public float $boost
Résultat float

$className public_oe property

public string $className
Résultat string

$fieldMappings public_oe property

The ReflectionProperty instances of the mapped class.
public array|ElasticField[],Doctrine\Search\Mapping\Annotations $fieldMappings
Résultat array | Doctrine\Search\Mapping\Annotations\ElasticField[]

$identifier public_oe property

The field name of the identifier
public string $identifier
Résultat string

$index public_oe property

public string $index
Résultat string

$numberOfReplicas public_oe property

public int $numberOfReplicas
Résultat integer

$numberOfShards public_oe property

public int $numberOfShards
Résultat integer

$parameters public_oe property

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

$parent public_oe property

public string $parent
Résultat string

$reflClass public_oe property

The ReflectionClass instance of the mapped class.
public ReflectionClass $reflClass
Résultat ReflectionClass

$reflFields public_oe property

The ReflectionClass instance of the mapped class.
public ReflectionClass $reflFields
Résultat ReflectionClass

$rootMappings public_oe property

Additional root annotations of the mapped class.
public array|ElasticRoot[],Doctrine\Search\Mapping\Annotations $rootMappings
Résultat array | Doctrine\Search\Mapping\Annotations\ElasticRoot[]

$source public_oe property

public bool $source
Résultat boolean

$timeToLive public_oe property

public int $timeToLive
Résultat integer

$type public_oe property

public string $type
Résultat string

$value public_oe property

public int $value
Résultat integer