PHP Класс Storm\Core\Mapping\DomainDatabaseMap

Автор: Elliot Levin ([email protected])
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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 ( )

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

Метод Описание
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.

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

Метод Описание
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

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

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

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
Результат void

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

The method to specify the database instance.
abstract protected Database ( ) : Database
Результат Storm\Core\Relational\Database

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

The method to specify the domain instance.
abstract protected Domain ( ) : Domain
Результат Storm\Core\Object\Domain

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

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

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

final public GetDatabase ( ) : Database
Результат Storm\Core\Relational\Database The Database instance

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

final public GetDomain ( ) : Domain
Результат Storm\Core\Object\Domain The Domain instance

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

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)
Результат Storm\Core\Mapping\IEntityRelationalMap | null The relational map or null if not found

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

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.
Результат IEntityRelationalMap:null

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

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
Результат boolean

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

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
Результат 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 MapDiscardedRelationships ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, array $ObjectDiscardedRelationships ) : DiscardedRelationship[]
$EntityRelationalMap Storm\Core\Mapping\IEntityRelationalMap
$ObjectDiscardedRelationships array
Результат Storm\Core\Relational\DiscardedRelationship[]

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

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
Результат void

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

abstract protected MapExpression ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, Expression $Expression ) : Expression[]
$EntityRelationalMap Storm\Core\Mapping\IEntityRelationalMap
$Expression Storm\Core\Object\Expressions\Expression
Результат Storm\Core\Relational\Expressions\Expression[] The equivalent expressions

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

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
Результат Storm\Core\Relational\PersistedRelationship[]

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

final public MapProcedure ( Storm\Core\Object\IProcedure $ObjectProcedure ) : Procedure
$ObjectProcedure Storm\Core\Object\IProcedure The object procedure
Результат Storm\Core\Relational\Procedure The equivalent relational procedure

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

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
Результат Storm\Core\Relational\RelationshipChange

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

final public MapRequest ( Storm\Core\Object\IRequest $ObjectRequest ) : Request
$ObjectRequest Storm\Core\Object\IRequest The object request
Результат Storm\Core\Relational\Request The equivalent relational request

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

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

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

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 MapRowsToRevivalData ( string $EntityType, array $ResultRows ) : RevivalData[]
$EntityType string The type of entity to revive as
$ResultRows array The result row to ma
Результат Storm\Core\Object\RevivalData[] The mapped revival data

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

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

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

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
Результат Storm\Core\Mapping\IEntityRelationalMap The registered entity relational map

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

public __construct ( )