Storm\Core\Object\UnitOfWork::DiscardWhere PHP Method

DiscardWhere() public method

Discard all entities matching the supplied criterion.
public DiscardWhere ( Storm\Core\Object\ICriterion $Criterion )
$Criterion Storm\Core\Object\ICriterion The criterion to discard by
    public function DiscardWhere(ICriterion $Criterion)
    {
        if (!$this->Domain->HasEntityMap($Criterion->GetEntityType())) {
            throw $this->TypeMismatch('criterion', $Criterion->GetEntityType());
        }
        $this->DiscardedCriteria[spl_object_hash($Criterion)] = $Criterion;
    }

Usage Example

Esempio n. 1
0
 /**
  * @expectedException \Storm\Core\Object\ObjectException
  */
 public function testUnmappedCriterionIsDisallowed()
 {
     $Criterion = $this->getMock(self::CoreObjectNamespace . 'ICriterion');
     $Criterion->expects($this->any())->method('GetEntityType')->will($this->returnValue(__CLASS__));
     $this->UnitOfWork->DiscardWhere($Criterion);
 }
All Usage Examples Of Storm\Core\Object\UnitOfWork::DiscardWhere