PHP Class Storm\Core\Mapping\DomainDatabaseMap

Author: Elliot Levin ([email protected])
Afficher le fichier Open project: timetoogo/penumbra Class Usage Examples

Méthodes publiques

Méthode Description
Commit ( array $EntitiesToPersist, array $ProceduresToExecute, array $EntitiesToDiscard, array $CriteriaToDiscard ) : void Commits the supplied operations to the underlying database within a transactional scope.
Factory ( ) This class can be very expensive to instantiate, so this provides a factory closure if required.
GetDatabase ( ) : Database
GetDomain ( ) : Domain
GetEntityRelationalMap ( string $EntityType ) : Storm\Core\Mapping\IEntityRelationalMap | null Gets the registered relational map for the given entity type.
GetEntityRelationalMapByPrimaryKeyTable ( string $TableName ) : IEntityRelationalMap:null Gets the registered relational map for the given primary key table name.
HasEntityRelationalMap ( string $EntityType ) : boolean Returns if this contains an relational map for the given type of entity.
Load ( Storm\Core\Object\IRequest $ObjectRequest ) : array | object | null Loads all entities that are specified from the given request instance.
MapDiscardedRelationships ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ObjectDiscardedRelationships ) : DiscardedRelationship[]
MapEntityToRelationalRequest ( string $EntityType, Request $RelationalRequest, array $AlreadyKnownProperties = [] ) : void
MapPersistedRelationships ( UnitOfWork $UnitOfWork, Transaction $Transaction, Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ObjectPersistedRelationships ) : PersistedRelationship[]
MapProcedure ( Storm\Core\Object\IProcedure $ObjectProcedure ) : Procedure
MapRelationshipChanges ( UnitOfWork $UnitOfWork, Transaction $Transaction, Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ObjectRelationshipChanges ) : RelationshipChange
MapRequest ( Storm\Core\Object\IRequest $ObjectRequest ) : Request
MapResultRowDataToRevivalData ( $EntityType, ResultRow $ResultRow )
MapResultRowsToRevivalData ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ResultRowArray, array $RevivalDataArray )
MapRowsToRevivalData ( string $EntityType, array $ResultRows ) : RevivalData[]
__construct ( )

Méthodes protégées

Méthode Description
Database ( ) : Database The method to specify the database instance.
Domain ( ) : Domain The method to specify the domain instance.
MapExpression ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, Expression $Expression ) : Expression[]
RegisterEntityRelationalMaps ( Registrar $Registrar ) This is where you register your EntityRelationalMap classes.
VerifyEntityTypeIsMapped ( string $EntityType ) : Storm\Core\Mapping\IEntityRelationalMap Verifies that an entity type is mapped and returns the relational map if is found.

Private Methods

Méthode Description
AddEntityRelationMap ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap ) Adds an entity relational map instance to this domain database map.
MapCriterion ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, Storm\Core\Object\ICriterion $ObjectCriterion, Criterion $RelationalCriterion ) : void
MapEntityDataToTransaction ( UnitOfWork $UnitOfWork, Transaction $Transaction, Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $EntityDataArray ) : Storm\Core\Relational\ResultRows[]
MapExpressions ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $Expressions ) : Expression[]
MapObjectCriterion ( Storm\Core\Object\ICriterion $ObjectCriterion ) : Criterion
MapPersistenceDataToTransaction ( UnitOfWork $UnitOfWork, Transaction $Transaction, array $PersistenceDataArray ) : Storm\Core\Relational\ResultRows[]
MapPropetiesToRelationalRequest ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, Request $RelationalRequest, array $Properties = null ) : void
MapUnitOfWorkToTransaction ( UnitOfWork $UnitOfWork, Transaction $Transaction ) : void

Method Details

Commit() final public méthode

Commits the supplied operations to the underlying database within a transactional scope.
final public Commit ( array $EntitiesToPersist, array $ProceduresToExecute, array $EntitiesToDiscard, array $CriteriaToDiscard ) : void
$EntitiesToPersist array The entities to persist
$ProceduresToExecute array The procedures to execute
$EntitiesToDiscard array The entities to discard
$CriteriaToDiscard array The criteria of entities to discard
Résultat void

Database() abstract protected méthode

The method to specify the database instance.
abstract protected Database ( ) : Database
Résultat Storm\Core\Relational\Database

Domain() abstract protected méthode

The method to specify the domain instance.
abstract protected Domain ( ) : Domain
Résultat Storm\Core\Object\Domain

Factory() final public static méthode

This class can be very expensive to instantiate, so this provides a factory closure if required.
final public static Factory ( )

GetDatabase() final public méthode

final public GetDatabase ( ) : Database
Résultat Storm\Core\Relational\Database The Database instance

GetDomain() final public méthode

final public GetDomain ( ) : Domain
Résultat Storm\Core\Object\Domain The Domain instance

GetEntityRelationalMap() final public méthode

Gets the registered relational map for the given entity type.
final public GetEntityRelationalMap ( string $EntityType ) : Storm\Core\Mapping\IEntityRelationalMap | null
$EntityType string The type of the entity (sub classes will resolve)
Résultat Storm\Core\Mapping\IEntityRelationalMap | null The relational map or null if not found

GetEntityRelationalMapByPrimaryKeyTable() final public méthode

Gets the registered relational map for the given primary key table name.
final public GetEntityRelationalMapByPrimaryKeyTable ( string $TableName ) : IEntityRelationalMap:null
$TableName string The name of primary key table.
Résultat IEntityRelationalMap:null

HasEntityRelationalMap() final public méthode

Returns if this contains an relational map for the given type of entity.
final public HasEntityRelationalMap ( string $EntityType ) : boolean
$EntityType string The type of the entity
Résultat boolean

Load() final public méthode

Loads all entities that are specified from the given request instance.
final public Load ( Storm\Core\Object\IRequest $ObjectRequest ) : array | object | null
$ObjectRequest Storm\Core\Object\IRequest The request to load
Résultat array | object | null Depending on the supplied request, either all the entities are returned as an array or the first is returned or null if none are found.

MapDiscardedRelationships() final public méthode

final public MapDiscardedRelationships ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ObjectDiscardedRelationships ) : DiscardedRelationship[]
$EntityRelationalMap Storm\Core\Mapping\IEntityRelationalMap
$ObjectDiscardedRelationships array
Résultat Storm\Core\Relational\DiscardedRelationship[]

MapEntityToRelationalRequest() final public méthode

final public MapEntityToRelationalRequest ( string $EntityType, Request $RelationalRequest, array $AlreadyKnownProperties = [] ) : void
$EntityType string The type of entity
$RelationalRequest Storm\Core\Relational\Request The request to add to
$AlreadyKnownProperties array
Résultat void

MapExpression() abstract protected méthode

abstract protected MapExpression ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, Expression $Expression ) : Expression[]
$EntityRelationalMap Storm\Core\Mapping\IEntityRelationalMap
$Expression Storm\Core\Object\Expressions\Expression
Résultat Storm\Core\Relational\Expressions\Expression[] The equivalent expressions

MapPersistedRelationships() final public méthode

final public MapPersistedRelationships ( UnitOfWork $UnitOfWork, Transaction $Transaction, Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ObjectPersistedRelationships ) : PersistedRelationship[]
$UnitOfWork Storm\Core\Object\UnitOfWork
$Transaction Storm\Core\Relational\Transaction
$EntityRelationalMap Storm\Core\Mapping\IEntityRelationalMap
$ObjectPersistedRelationships array
Résultat Storm\Core\Relational\PersistedRelationship[]

MapProcedure() final public méthode

final public MapProcedure ( Storm\Core\Object\IProcedure $ObjectProcedure ) : Procedure
$ObjectProcedure Storm\Core\Object\IProcedure The object procedure
Résultat Storm\Core\Relational\Procedure The equivalent relational procedure

MapRelationshipChanges() final public méthode

final public MapRelationshipChanges ( UnitOfWork $UnitOfWork, Transaction $Transaction, Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ObjectRelationshipChanges ) : RelationshipChange
$UnitOfWork Storm\Core\Object\UnitOfWork
$Transaction Storm\Core\Relational\Transaction
$EntityRelationalMap Storm\Core\Mapping\IEntityRelationalMap
$ObjectRelationshipChanges array
Résultat Storm\Core\Relational\RelationshipChange

MapRequest() final public méthode

final public MapRequest ( Storm\Core\Object\IRequest $ObjectRequest ) : Request
$ObjectRequest Storm\Core\Object\IRequest The object request
Résultat Storm\Core\Relational\Request The equivalent relational request

MapResultRowDataToRevivalData() final public méthode

final public MapResultRowDataToRevivalData ( $EntityType, ResultRow $ResultRow )
$ResultRow Storm\Core\Relational\ResultRow

MapResultRowsToRevivalData() final public méthode

final public MapResultRowsToRevivalData ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ResultRowArray, array $RevivalDataArray )
$EntityRelationalMap Storm\Core\Mapping\IEntityRelationalMap The entity relational map
$ResultRowArray array
$RevivalDataArray array

MapRowsToRevivalData() final public méthode

final public MapRowsToRevivalData ( string $EntityType, array $ResultRows ) : RevivalData[]
$EntityType string The type of entity to revive as
$ResultRows array The result row to ma
Résultat Storm\Core\Object\RevivalData[] The mapped revival data

RegisterEntityRelationalMaps() abstract protected méthode

This is where you register your EntityRelationalMap classes.
abstract protected RegisterEntityRelationalMaps ( Registrar $Registrar )
$Registrar Storm\Core\Containers\Registrar

VerifyEntityTypeIsMapped() final protected méthode

Verifies that an entity type is mapped and returns the relational map if is found.
final protected VerifyEntityTypeIsMapped ( string $EntityType ) : Storm\Core\Mapping\IEntityRelationalMap
$EntityType string The entity type
Résultat Storm\Core\Mapping\IEntityRelationalMap The registered entity relational map

__construct() public méthode

public __construct ( )