PHP Класс Storm\Core\Object\Domain

The domain represents a group of entities, their properties and relationships. A single entity is represented through an entity map.
Автор: Elliot Levin ([email protected])
Наследование: use trait Storm\Core\Helpers\Type
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Apply ( object $Entity, PropertyData $PropertyData ) : void Applies the supplied property data to the supplied entity instance.
BuildUnitOfWork ( array $EntitiesToPersist = [], array $ProceduresToExecute = [], array $EntitiesToDiscard = [], array $CriterionToDiscard = [] ) : UnitOfWork Constructs a unit of work instance containing the supplied operations to commit.
Discard ( UnitOfWork $UnitOfWork, object $Entity ) : DiscardenceData Discard an entity relationships to the supplied unit of work and returns the entity's discardence data.
DiscardedIdentifyingRelationship ( $ParentEntity, object $ChildEntity, UnitOfWork $UnitOfWork ) : DiscardedRelationship Constructs a discarded identifying relationship between the parent and child entity.
DiscardedRelationship ( object $Entity, object $RelatedEntity ) : DiscardedRelationship Constructs a discarded non-identifying relationship between the two supplied entities.
DoShareIdentity ( object $Entity, object $OtherEntity ) : boolean Determines is two entities share the same identity.
GetEntityMap ( string $EntityType ) : Storm\Core\Object\IEntityMap | null
GetEntityMaps ( ) : Storm\Core\Object\IEntityMap[]
HasEntityMap ( string $EntityType ) : boolean
HasIdentity ( object $Entity ) : boolean
Identity ( object $Entity ) : Identity Gets the identity from the supplied entity.
LoadEntities ( RevivalData $RevivalData, array $Entities ) : void Loads an array of entities with the supplied revival data.
LoadEntity ( RevivalData $RevivalData, object $Entity ) : void Loads an entity instance with the supplied revival data.
Persist ( UnitOfWork $UnitOfWork, object $Entity ) : PersistenceData Persists an entity relationships to the supplied unit of work and returns the entity's persistence data.
PersistRelationships ( UnitOfWork $UnitOfWork, object $Entity ) : void Persists an entity relationships to the supplied unit of work.
PersistedIdentifyingRelationship ( $ParentEntity, object $ChildEntity, UnitOfWork $UnitOfWork ) : PersistedRelationship Constructs a persisted identifying relationship between the parent and child entity.
PersistedRelationship ( $ParentEntity, object $RelatedEntity ) : PersistedRelationship Constructs a discarded non-identifying relationship between the two supplied entities.
ReviveEntities ( string $EntityType, array $RevivalData ) : object[] Revives an array of entities from the supplied array of revival data.
__construct ( )

Защищенные методы

Метод Описание
AddEntityMap ( Storm\Core\Object\IEntityMap $EntityMap ) : void Adds an entity map to the domain.
RegisterEntityMaps ( Registrar $Registrar ) : void The method to register the entity maps within this domain.

Приватные методы

Метод Описание
VerifyEntity ( string $Method, object $Entity ) : Storm\Core\Object\IEntityMap Verifies that an entity is valid in this domain.

Описание методов

AddEntityMap() закрытый защищенный Метод

Adds an entity map to the domain.
final protected AddEntityMap ( Storm\Core\Object\IEntityMap $EntityMap ) : void
$EntityMap Storm\Core\Object\IEntityMap The entity map to add.
Результат void

Apply() закрытый публичный Метод

Applies the supplied property data to the supplied entity instance.
final public Apply ( object $Entity, PropertyData $PropertyData ) : void
$Entity object The entity to apply the property data
$PropertyData PropertyData The property data apply
Результат void

BuildUnitOfWork() закрытый публичный Метод

Constructs a unit of work instance containing the supplied operations to commit.
final public BuildUnitOfWork ( array $EntitiesToPersist = [], array $ProceduresToExecute = [], array $EntitiesToDiscard = [], array $CriterionToDiscard = [] ) : UnitOfWork
$EntitiesToPersist array
$ProceduresToExecute array
$EntitiesToDiscard array
$CriterionToDiscard array
Результат UnitOfWork The constructed unit of work

Discard() закрытый публичный Метод

Discard an entity relationships to the supplied unit of work and returns the entity's discardence data.
final public Discard ( UnitOfWork $UnitOfWork, object $Entity ) : DiscardenceData
$UnitOfWork UnitOfWork The unit of work to discard to
$Entity object The entity to discard
Результат DiscardenceData The discardence data of the entity

DiscardedIdentifyingRelationship() закрытый публичный Метод

NOTE: The child entity relationships will be discarded in the supplied unit of work.
final public DiscardedIdentifyingRelationship ( $ParentEntity, object $ChildEntity, UnitOfWork $UnitOfWork ) : DiscardedRelationship
$ChildEntity object
$UnitOfWork UnitOfWork
Результат DiscardedRelationship The discarded relationship

DiscardedRelationship() закрытый публичный Метод

Constructs a discarded non-identifying relationship between the two supplied entities.
final public DiscardedRelationship ( object $Entity, object $RelatedEntity ) : DiscardedRelationship
$Entity object
$RelatedEntity object
Результат DiscardedRelationship The discarded relationship

DoShareIdentity() закрытый публичный Метод

Determines is two entities share the same identity.
final public DoShareIdentity ( object $Entity, object $OtherEntity ) : boolean
$Entity object
$OtherEntity object
Результат boolean Whether or not that the entities have the same identity

GetEntityMap() закрытый публичный Метод

final public GetEntityMap ( string $EntityType ) : Storm\Core\Object\IEntityMap | null
$EntityType string The type of entity that the entity map represents
Результат Storm\Core\Object\IEntityMap | null The entity map or null if it is not registered

GetEntityMaps() закрытый публичный Метод

final public GetEntityMaps ( ) : Storm\Core\Object\IEntityMap[]
Результат Storm\Core\Object\IEntityMap[] The registered entity maps

HasEntityMap() закрытый публичный Метод

final public HasEntityMap ( string $EntityType ) : boolean
$EntityType string The type of entity
Результат boolean

HasIdentity() закрытый публичный Метод

final public HasIdentity ( object $Entity ) : boolean
$Entity object The entity to check
Результат boolean Whether or not the entity has an identity

Identity() закрытый публичный Метод

Gets the identity from the supplied entity.
final public Identity ( object $Entity ) : Identity
$Entity object
Результат Identity

LoadEntities() закрытый публичный Метод

Loads an array of entities with the supplied revival data.
final public LoadEntities ( RevivalData $RevivalData, array $Entities ) : void
$RevivalData RevivalData The revival data to load the entity with
$Entities array The entities to load
Результат void

LoadEntity() закрытый публичный Метод

Loads an entity instance with the supplied revival data.
final public LoadEntity ( RevivalData $RevivalData, object $Entity ) : void
$RevivalData RevivalData The revival data to load the entity with
$Entity object The entity to load
Результат void

Persist() закрытый публичный Метод

Persists an entity relationships to the supplied unit of work and returns the entity's persistence data.
final public Persist ( UnitOfWork $UnitOfWork, object $Entity ) : PersistenceData
$UnitOfWork UnitOfWork The unit of work to persist to
$Entity object The entity to persist
Результат PersistenceData The persistence data of the entity

PersistRelationships() закрытый публичный Метод

Persists an entity relationships to the supplied unit of work.
final public PersistRelationships ( UnitOfWork $UnitOfWork, object $Entity ) : void
$UnitOfWork UnitOfWork The unit of work to persist to
$Entity object The entity to persist
Результат void The persistence data of the entity

PersistedIdentifyingRelationship() закрытый публичный Метод

NOTE: The child entity relationships will be persisted in the supplied unit of work.
final public PersistedIdentifyingRelationship ( $ParentEntity, object $ChildEntity, UnitOfWork $UnitOfWork ) : PersistedRelationship
$ChildEntity object
$UnitOfWork UnitOfWork
Результат PersistedRelationship The persisted relationship

PersistedRelationship() закрытый публичный Метод

Constructs a discarded non-identifying relationship between the two supplied entities.
final public PersistedRelationship ( $ParentEntity, object $RelatedEntity ) : PersistedRelationship
$RelatedEntity object
Результат PersistedRelationship The persisted relationship

RegisterEntityMaps() абстрактный защищенный Метод

The method to register the entity maps within this domain.
abstract protected RegisterEntityMaps ( Registrar $Registrar ) : void
$Registrar Storm\Core\Containers\Registrar
Результат void

ReviveEntities() закрытый публичный Метод

Revives an array of entities from the supplied array of revival data.
final public ReviveEntities ( string $EntityType, array $RevivalData ) : object[]
$EntityType string The type of entities to revive
$RevivalData array The array of revival data
Результат object[] The revived entities

__construct() публичный Метод

public __construct ( )