Skip to content

Commit

Permalink
Zend\Db Features and Refactoring (story zendframework#41)
Browse files Browse the repository at this point in the history
* Added selectWith() to TableGateway
  • Loading branch information
Ralph Schindler committed Mar 16, 2012
1 parent 23a1269 commit 8ab4e6d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions library/Zend/Db/TableGateway/TableGateway.php
Expand Up @@ -262,6 +262,16 @@ public function select($where = null)
$select->where($where);
}

return $this->selectWith($select);
}

public function selectWith(Select $select)
{
$selectState = $select->getRawState();
if ($selectState['table'] != $this->tableName || $selectState['schema'] != $this->schema) {
throw new \RuntimeException('The table name and schema of the provided select object must match that of the table');
}

$statement = $this->adapter->createStatement();
$select->prepareStatement($this->adapter, $statement);

Expand All @@ -271,11 +281,6 @@ public function select($where = null)
return $resultSet;
}

public function selectWith(Select $select)
{

}

/**
* Insert
*
Expand Down

0 comments on commit 8ab4e6d

Please sign in to comment.