public function testIterateOverAppended() { $event = $this->getMock(DomainEvent::class); $collection = new EventCollection(); $collection->append($event); foreach ($collection as $i => $element) { $this->assertEquals(0, $i); $this->assertSame($event, $element); } }
/** * Provides a complete list of all lifecycle events provided by the set providers. * * @return EventCollectionInterface */ public function getEvents() { $collection = new EventCollection(); foreach ($this->providers as $eachProvider) { foreach ($eachProvider->getEvents() as $eachEvent) { $collection->addEvent($eachEvent); } } return $collection; }
function __construct(Mapper $mapper, \PDOStatement $stmt_handle, array $valueArray) { parent::__construct(null, $mapper); $this->stmt = $stmt_handle; $this->valueArray = $valueArray; }
function __construct(DomainObjectFactory $dofact, PDOStatement $stmt_handle, array $valueArray) { parent::__construct(null, $dofact); $this->stmt = $stmt_handle; $this->valueArray = $valueArray; }