1
0
mirror of synced 2025-03-04 20:03:21 +03:00

Renamed fetchRow to fetchAssoc, as defined in @todo list. Renamed getRollbackOnly to isRollbackOnly, since it is more consistent to its purpose.

This commit is contained in:
Guilherme Blanco 2010-05-06 18:45:18 -03:00
parent b12b8b0041
commit 65fbb9f7a4
3 changed files with 6 additions and 7 deletions

View File

@ -310,9 +310,8 @@ class Connection implements DriverConnection
* @param string $statement The SQL query.
* @param array $params The query parameters.
* @return array
* @todo Rename: fetchAssoc
*/
public function fetchRow($statement, array $params = array())
public function fetchAssoc($statement, array $params = array())
{
return $this->executeQuery($statement, $params)->fetch(PDO::FETCH_ASSOC);
}
@ -583,10 +582,10 @@ class Connection implements DriverConnection
* represents a row of the result set.
* @return mixed The projected result of the query.
*/
public function project($query, array $params = array(), Closure $function)
public function project($query, array $params, Closure $function)
{
$result = array();
$stmt = $this->executeQuery($query, $params);
$stmt = $this->executeQuery($query, $params ?: array());
while ($row = $stmt->fetch()) {
$result[] = $function($row);
@ -820,7 +819,7 @@ class Connection implements DriverConnection
* @return boolean
* @throws ConnectionException If no transaction is active.
*/
public function getRollbackOnly()
public function isRollbackOnly()
{
if ($this->_transactionNestingLevel == 0) {
throw ConnectionException::noActiveTransaction();

View File

@ -164,7 +164,7 @@ class EntityManager
*/
public function getTransaction()
{
return $this->_transaction;
return $this->_transaction;
}
/**

View File

@ -158,6 +158,6 @@ final class EntityTransaction
*/
public function isRollbackOnly()
{
return $this->_conn->getRollbackOnly();
return $this->_conn->isRollbackOnly();
}
}