PHP Class Blast\Orm\Entity\Definition

Inheritance: implements Blast\Orm\Entity\DefinitionInterface, implements Blast\Orm\EventEmitterFactoryInterface, implements Blast\Orm\MapperFactoryInterface, use trait League\Event\EmitterAwareTrait, use trait Blast\Orm\EventEmitterFactoryTrait, use trait Blast\Orm\MapperFactoryTrait
Show file Open project: phpthinktank/blast-orm Class Usage Examples

Public Methods

Method Description
getConfiguration ( ) : array
getEmitter ( ) : ArrayObject | object Load event emitter. If entity has events and no emitter exists, create a new emitter.
getEntity ( ) : ArrayObject | object Get the entity object.
getEntityCollection ( ) : SplStack | object Get the custom entity collection
getFields ( ) : Doctrine\DBAL\Schema\Column[] Get fields
getIndexes ( ) : Doctrine\DBAL\Schema\Index[] Get indexes
getMapper ( ) : Blast\Orm\MapperInterface Get entity mapper
getPrimaryKeyName ( ) : string Get name of primary key
getRelations ( ) : Blast\Orm\Relations\RelationInterface[] Get an array of relations
getTableName ( boolean $withPrefix = true ) : string Get table name
setConfiguration ( array $configuration ) : Definition Add additional configuration. Configuration will be merged into

Private Methods

Method Description
mergeConfiguration ( array $configuration ) Merge partial configuration into definition configuration. Normalize partial configuration keys before add them to configuration. Add custom configuration after adding known configuration.
processFields ( ) Setup entity fields and determine undefined fields from entity with type string

Method Details

getConfiguration() public method

public getConfiguration ( ) : array
return array

getEmitter() public method

Load event emitter. If entity has events and no emitter exists, create a new emitter.
public getEmitter ( ) : ArrayObject | object
return ArrayObject | object

getEntity() public method

Get the entity object.
public getEntity ( ) : ArrayObject | object
return ArrayObject | object

getEntityCollection() public method

Get the custom entity collection
public getEntityCollection ( ) : SplStack | object
return SplStack | object

getFields() public method

Get fields
public getFields ( ) : Doctrine\DBAL\Schema\Column[]
return Doctrine\DBAL\Schema\Column[]

getIndexes() public method

Get indexes
public getIndexes ( ) : Doctrine\DBAL\Schema\Index[]
return Doctrine\DBAL\Schema\Index[]

getMapper() public method

Get entity mapper
public getMapper ( ) : Blast\Orm\MapperInterface
return Blast\Orm\MapperInterface

getPrimaryKeyName() public method

Get name of primary key
public getPrimaryKeyName ( ) : string
return string

getRelations() public method

Get an array of relations
public getRelations ( ) : Blast\Orm\Relations\RelationInterface[]
return Blast\Orm\Relations\RelationInterface[]

getTableName() public method

Add prefix if if $withPrefix is true and a prefix exists
public getTableName ( boolean $withPrefix = true ) : string
$withPrefix boolean
return string

setConfiguration() public method

Add additional configuration. Configuration will be merged into
public setConfiguration ( array $configuration ) : Definition
$configuration array
return Definition