diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 094d8ac69..cb54a0255 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -266,6 +266,21 @@ class DboSource extends DataSource { return $this->_result; } } +/** + * Returns a row from given resultset as an array . + * + * @param bool $assoc Associative array only, or both? + * @return array The fetched row as an array + */ + function fetchRow($assoc = false) { + if (is_resource($this->_result)) { + $this->resultSet($this->_result); + $resultRow = $this->fetchResult(); + return $resultRow; + } else { + return null; + } + } /** * Returns a single row of results from the _last_ SQL query. *