Exemplo n.º 1
0
 public function selectWith(Select $select, $scrollable = true)
 {
     // Get the data
     $adapter = $this->getReadAdapter();
     $statement = $adapter->createStatement();
     $select->prepareStatement($adapter, $statement);
     $result = $statement->execute();
     if ($scrollable) {
         // Convert data to an array so we can iterate more than once
         $resultArray = array();
         foreach ($result as $row) {
             $resultArray[] = $this->toScalarValueArray($row);
         }
         $result = $resultArray;
     }
     // Create the ResultSet
     $resultSet = new ResultSet();
     $resultSet->setRowObjectPrototype($this->getModelPrototype());
     $resultSet->setDataSource($result);
     return $resultSet;
 }
Exemplo n.º 2
0
 public function testRowObjectPrototypeIsMutable()
 {
     $row = new Row();
     $this->set->setRowObjectPrototype($row);
     $this->assertSame($row, $this->set->getRowObjectPrototype());
 }