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
파일 보기 프로젝트 열기: timetoogo/penumbra 1 사용 예제들

공개 메소드들

메소드 설명
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 ( )