From bc745b234a391d9093c1613d4822b261478037f8 Mon Sep 17 00:00:00 2001 From: nate <nate@cakephp.org> Date: Wed, 12 Jul 2006 04:37:49 +0000 Subject: [PATCH] Making same change as [3235] git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3236 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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. *