예제 #1
0
 /**
  * Overwritten Load a assoc list of database rows
  *
  * @access	public
  * @param string The field name of a primary key
  * @return array If <var>key</var> is empty as sequential list of returned records.
  */
 function loadAssocList($key = '', $translate = true, $language = null)
 {
     if (!$translate) {
         return parent::loadAssocList($key);
     }
     $result = null;
     $rows = $this->loadObjectList($key, $translate, $language);
     $pfunc = $this->_profile();
     $results = array();
     if ($rows != null) {
         foreach ($rows as $row) {
             if ($key != "") {
                 $results[$row->{$key}] = get_object_vars($row);
             } else {
                 $results[] = get_object_vars($row);
             }
         }
         $pfunc = $this->_profile($pfunc);
     }
     return $results;
 }
 /**
  * Overwritten Load a assoc list of database rows
  *
  * @access	public
  * @param string The field name of a primary key
  * @return array If <var>key</var> is empty as sequential list of returned records.
  */
 public function loadAssocList($key = '', $column = null, $translate = true, $language = null)
 {
     if ($this->skipjf) {
         return parent::loadAssocList($key);
     }
     $this->translate = $translate;
     if (!$translate) {
         $reslt = parent::loadAssocList($key);
         return $reslt;
     }
     $result = null;
     $rows = $this->loadObjectList($key, 'stdClass', $translate, $language);
     $pfunc = $this->profile();
     $results = array();
     if ($rows != null) {
         foreach ($rows as $row) {
             $value = $column ? isset($row->{$column}) ? $row->{$column} : get_object_vars($row) : get_object_vars($row);
             if ($key != "") {
                 $results[$row->{$key}] = $value;
             } else {
                 $results[] = $value;
             }
         }
         $pfunc = $this->profile($pfunc);
     }
     unset($rows);
     return $results;
 }