/** * Iterates over the rows of data in the container and sends each row to the row mapper. * @param array $requestedTypes * @param Container $data * @param array $splitMapper * @return array */ protected function mapData(array $requestedTypes, Container $data, array $splitMapper) { $results = []; if ($data->hasMultipleResults()) { foreach ($data->getData() as $row) { $objects = $this->createTypes($requestedTypes); $results[] = $this->mapRow($row, $objects, $splitMapper); } } else { $objects = $this->createTypes($requestedTypes); $results[] = $this->mapRow($data->getData(), $objects, $splitMapper); } return $results; }
public function testMappableIteratorAggregate() { $mappable = new Container($this->getMock('\\IteratorAggregate')); $this->assertTrue($mappable->getData() instanceof \IteratorAggregate); }