Execute() public method

Add a procedure to be executed.
public Execute ( Storm\Core\Object\IProcedure $Procedure ) : void
$Procedure Storm\Core\Object\IProcedure The procedure to execute
return void
コード例 #1
0
ファイル: UnitOfWorkTest.php プロジェクト: timetoogo/penumbra
 /**
  * @expectedException \Storm\Core\Object\ObjectException
  */
 public function testUnmappedProcedureIsDisallowed()
 {
     $Procedure = $this->getMock(self::CoreObjectNamespace . 'IProcedure');
     $Procedure->expects($this->any())->method('GetEntityType')->will($this->returnValue(__CLASS__));
     $this->UnitOfWork->Execute($Procedure);
 }
コード例 #2
0
ファイル: Domain.php プロジェクト: timetoogo/penumbra
 /**
  * Constructs a unit of work instance containing the supplied operations to commit.
  * 
  * @param object[] $EntitiesToPersist
  * @param IProcedure[] $ProceduresToExecute
  * @param object[] $EntitiesToDiscard
  * @param ICriterion[] $CriterionToDiscard
  * @return UnitOfWork The constructed unit of work
  */
 public final function BuildUnitOfWork(array $EntitiesToPersist = [], array $ProceduresToExecute = [], array $EntitiesToDiscard = [], array $CriterionToDiscard = [])
 {
     $UnitOfWork = new UnitOfWork($this);
     foreach ($EntitiesToPersist as $Entity) {
         $UnitOfWork->Persist($Entity);
     }
     foreach ($ProceduresToExecute as $Procedure) {
         $UnitOfWork->Execute($Procedure);
     }
     foreach ($EntitiesToDiscard as $Entity) {
         $UnitOfWork->Discard($Entity);
     }
     foreach ($CriterionToDiscard as $Criterion) {
         $UnitOfWork->DiscardWhere($Criterion);
     }
     return $UnitOfWork;
 }