PHP Class Storm\Api\Base\Repository

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

Protected Properties

Свойство Type Description
$DomainDatabaseMap Storm\Core\Mapping\DomainDatabaseMap The DomainDatabaseMap to query.
$EntityMap Storm\Core\Object\IEntityMap The EntityMap for this repository.
$EntityType string The type of entity represented by this repository.
$FunctionToASTConverter FunctionToASTConverter
$IdentityProperties The properties representing the identity of the entity.

Méthodes publiques

Méthode Description
ClearChanges ( ) : void Clears all the pending changes awaiting to be commited to underlying DomainDatabaseMap.
Criterion ( ) : CriterionBuilder Quick access to a new CriterionBuilder instance.
Discard ( object | CriterionBuilder | Storm\Core\Object\ICriterion $EntityOrCriterion ) : void Adds an entity or criterion to the discardence queue.
DiscardAll ( array $Entities ) : void Adds an array of entities to the discardence queue.
Execute ( ProcedureBuilder $ProcedureBuilder ) : void Adds a procedure to the execution queue directly from the builder.
ExecuteProcedure ( Storm\Core\Object\IProcedure $Procedure ) : void Adds a procedure to the execution queue.
GetChanges ( ) : array Gets the pending changes.
GetIdentityMap ( ) : IdentityMap Gets the identity map used for this repository.
Load ( RequestBuilder $RequestBuilder ) : object | null | array Load a request directly from the builder instance.
LoadById ( $_ ) : object | null Loads an entity from given identity values or null if entity does not exist.
LoadRequest ( Storm\Core\Object\IRequest $Request ) : object | null | array Load entities specified by a request instance.
Persist ( object $Entity ) : void Adds an entity to the persistence queue.
PersistAll ( array $Entities ) : void Adds an array of entities to the persistence queue.
Procedure ( callable $ProcedureClosure ) : ProcedureBuilder Quick access to a new ProcedureBuilder instance.
Request ( ) : RequestBuilder Quick access to a new RequestBuilder instance.
SaveChanges ( ) : void Commits all specified changes to the underlying DomainDatabaseMap.
SetAutoSave ( boolean $AutoSave ) : void Set whether or not to automatically commit every change.
__construct ( DomainDatabaseMap $DomainDatabaseMap, FunctionToASTConverter $FunctionToASTConverter, $EntityType )

Méthodes protégées

Méthode Description
LoadByIdentity ( Identity $Identity ) : object | null Loads an entity from an identity instance.
VerifyEntity ( string $Method, object $Entity ) Verifies an entity to be valid for use in this repository.

Private Methods

Méthode Description
AutoSave ( ) : void Commits changes if AutoSave is enabled.

Method Details

ClearChanges() final public méthode

Clears all the pending changes awaiting to be commited to underlying DomainDatabaseMap.
final public ClearChanges ( ) : void
Résultat void

Criterion() final public méthode

Quick access to a new CriterionBuilder instance.
final public Criterion ( ) : CriterionBuilder
Résultat Storm\Api\Base\Fluent\CriterionBuilder

Discard() public méthode

If AutoSave is enabled, the action will be commited.
public Discard ( object | CriterionBuilder | Storm\Core\Object\ICriterion $EntityOrCriterion ) : void
$EntityOrCriterion object | Storm\Api\Base\Fluent\CriterionBuilder | Storm\Core\Object\ICriterion The entity or criterion to discard
Résultat void

DiscardAll() public méthode

If AutoSave is enabled, the action will be commited.
public DiscardAll ( array $Entities ) : void
$Entities array The entities to discard
Résultat void

Execute() public méthode

If AutoSave is enabled, the action will be commited.
public Execute ( ProcedureBuilder $ProcedureBuilder ) : void
$ProcedureBuilder Storm\Api\Base\Fluent\ProcedureBuilder The procedure to build and execute
Résultat void

ExecuteProcedure() public méthode

If AutoSave is enabled, the action will be commited.
public ExecuteProcedure ( Storm\Core\Object\IProcedure $Procedure ) : void
$Procedure Storm\Core\Object\IProcedure
Résultat void

GetChanges() final public méthode

Gets the pending changes.
final public GetChanges ( ) : array
Résultat array An array containing all the operations queues

GetIdentityMap() public méthode

Gets the identity map used for this repository.
public GetIdentityMap ( ) : IdentityMap
Résultat IdentityMap

Load() public méthode

Load a request directly from the builder instance.
public Load ( RequestBuilder $RequestBuilder ) : object | null | array
$RequestBuilder Storm\Api\Base\Fluent\RequestBuilder The builder representing the request to load
Résultat object | null | array The returned results

LoadById() public méthode

Loads an entity from given identity values or null if entity does not exist.
public LoadById ( $_ ) : object | null
Résultat object | null The returned entity or null

LoadByIdentity() protected méthode

Loads an entity from an identity instance.
protected LoadByIdentity ( Identity $Identity ) : object | null
$Identity Storm\Core\Object\Identity The identity of the entity
Résultat object | null

LoadRequest() public méthode

Load entities specified by a request instance.
public LoadRequest ( Storm\Core\Object\IRequest $Request ) : object | null | array
$Request Storm\Core\Object\IRequest The request to load
Résultat object | null | array

Persist() public méthode

If AutoSave is enabled, the action will be commited.
public Persist ( object $Entity ) : void
$Entity object The entity to persist
Résultat void

PersistAll() public méthode

If AutoSave is enabled, the action will be commited.
public PersistAll ( array $Entities ) : void
$Entities array The entities to persist
Résultat void

Procedure() final public méthode

Quick access to a new ProcedureBuilder instance.
final public Procedure ( callable $ProcedureClosure ) : ProcedureBuilder
$ProcedureClosure callable
Résultat Storm\Api\Base\Fluent\ProcedureBuilder

Request() final public méthode

Quick access to a new RequestBuilder instance.
final public Request ( ) : RequestBuilder
Résultat Storm\Api\Base\Fluent\RequestBuilder

SaveChanges() public méthode

Commits all specified changes to the underlying DomainDatabaseMap.
public SaveChanges ( ) : void
Résultat void

SetAutoSave() final public méthode

Set whether or not to automatically commit every change.
final public SetAutoSave ( boolean $AutoSave ) : void
$AutoSave boolean
Résultat void

VerifyEntity() final protected méthode

Verifies an entity to be valid for use in this repository.
final protected VerifyEntity ( string $Method, object $Entity )
$Method string __METHOD__
$Entity object The entity to verify

__construct() public méthode

public __construct ( DomainDatabaseMap $DomainDatabaseMap, FunctionToASTConverter $FunctionToASTConverter, $EntityType )
$DomainDatabaseMap Storm\Core\Mapping\DomainDatabaseMap
$FunctionToASTConverter FunctionToASTConverter

Property Details

$DomainDatabaseMap protected_oe property

The DomainDatabaseMap to query.
protected DomainDatabaseMap,Storm\Core\Mapping $DomainDatabaseMap
Résultat Storm\Core\Mapping\DomainDatabaseMap

$EntityMap protected_oe property

The EntityMap for this repository.
protected IEntityMap,Storm\Core\Object $EntityMap
Résultat Storm\Core\Object\IEntityMap

$EntityType protected_oe property

The type of entity represented by this repository.
protected string $EntityType
Résultat string

$FunctionToASTConverter protected_oe property

protected FunctionToASTConverter,Storm\Api\Base $FunctionToASTConverter
Résultat FunctionToASTConverter

$IdentityProperties protected_oe property

The properties representing the identity of the entity.
protected $IdentityProperties