From 825c4679551854f48c6c6b67e5c5b7f7322d24d2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 8 Jun 2010 20:25:59 +0200 Subject: improves previous, add active field to pearrepo table --- class/CommonTable.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'class/CommonTable.php') diff --git a/class/CommonTable.php b/class/CommonTable.php index e049188..8fd0471 100644 --- a/class/CommonTable.php +++ b/class/CommonTable.php @@ -194,13 +194,15 @@ abstract class CommonTable * * @param string $fieldkey name of the field to use as index * @param string $fieldvalue name of the field to use as value + * @param array $crit for request * * @return hashtable */ - public function getHashtable($fieldkey, $fieldvalue) + public function getHashtable($fieldkey, $fieldvalue, array $crit=array()) { - $crit = array('FIELDS' => array($fieldkey, $fieldvalue), - 'ORDER' => $fieldkey); + $crit['FIELDS'] = array($fieldkey, $fieldvalue); + $crit['ORDER'] = $fieldkey; + $tab = array(); foreach ($this->request($crit) as $data) { $tab[$data[$fieldkey]] = $data[$fieldvalue]; -- cgit