From 345324003fc7ca009be28844a3ccc789f957c205 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Skej=C3=B8?= Date: Mon, 24 Nov 2008 07:45:42 +0100 Subject: [PATCH] Added a single param to getColumn() --- AOOSModel.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AOOSModel.php b/AOOSModel.php index 6c0ca21..4e35073 100644 --- a/AOOSModel.php +++ b/AOOSModel.php @@ -285,11 +285,12 @@ class AOOSModel extends AOOSModule /** * Returns a given column * @param string $index The column index + * @param bool $single If set to true, a string with the first value in the column is returned instead of an array * @param int $start "From row" * @param int $end "To row". Inclusive. - * @return array + * @return array|string */ - public function getColumn($index, $start = null, $end = null) + public function getColumn($index, $single = false, $start = null, $end = null) { $data = $this->data(); $count = count($data); @@ -308,6 +309,10 @@ class AOOSModel extends AOOSModule $column[] = $data[$i][$index]; } + if ($single) { + $column = array_pop($column); + } + return $column; } -- 2.11.4.GIT