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
Mostrar archivo Open project: doctrine/search Class Usage Examples

Public Properties

Property 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

Public Methods

Method 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 method

public __construct ( $documentName )

__sleep() public method

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
return array The names of all the fields that should be serialized.

getAssociationMappedByTargetField() public method

public getAssociationMappedByTargetField ( $assocName )

getAssociationNames() public method

Currently not necessary but needed by Interface
public getAssociationNames ( ) : array
return array

getAssociationTargetClass() public method

Currently not necessary but needed by Interface
public getAssociationTargetClass ( string $assocName ) : string
$assocName string
return string

getFieldNames() public method

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

getIdentifier() public method

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

getIdentifierFieldNames() public method

Returns an array of identifier field names numerically indexed.
public getIdentifierFieldNames ( ) : array
return array

getIdentifierValues() public method

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

getName() public method

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

getReflectionClass() public method

Gets the ReflectionClass instance for this mapped class.
public getReflectionClass ( ) : ReflectionClass
return ReflectionClass

getTypeOfField() public method

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
return string

hasAssociation() public method

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

hasField() public method

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

initializeReflection() public method

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.
return void

isAssociationInverseSide() public method

public isAssociationInverseSide ( $assocName )

isCollectionValuedAssociation() public method

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

isIdentifier() public method

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

isSingleValuedAssociation() public method

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

mapField() public method

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

mapParameter() public method

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

mapRoot() public method

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

setIdentifier() public method

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

wakeupReflection() public method

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

Property Details

$boost public_oe property

public float $boost
return float

$className public_oe property

public string $className
return string

$fieldMappings public_oe property

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

$identifier public_oe property

The field name of the identifier
public string $identifier
return string

$index public_oe property

public string $index
return string

$numberOfReplicas public_oe property

public int $numberOfReplicas
return integer

$numberOfShards public_oe property

public int $numberOfShards
return integer

$parameters public_oe property

The ReflectionProperty parameters of the mapped class.
public array $parameters
return array

$parent public_oe property

public string $parent
return string

$reflClass public_oe property

The ReflectionClass instance of the mapped class.
public ReflectionClass $reflClass
return ReflectionClass

$reflFields public_oe property

The ReflectionClass instance of the mapped class.
public ReflectionClass $reflFields
return ReflectionClass

$rootMappings public_oe property

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

$source public_oe property

public bool $source
return boolean

$timeToLive public_oe property

public int $timeToLive
return integer

$type public_oe property

public string $type
return string

$value public_oe property

public int $value
return integer