getValueList() public method

Return value list.
public getValueList ( ) : array
return array
Ejemplo n.º 1
0
 function getValueList()
 {
     if (!$this->dictionary()) {
         return parent::getValueList();
     }
     $res = array();
     $o = array();
     if (!is_null($this->empty_value)) {
         $o = $o + array('' => array('name' => $this->empty_value));
     }
     /*
        // REVERT back sorting (from #1345) becasue it breaks vat rates
     $q=$this->dictionary->resetQuery('get_rows')->dsql('get_rows');
     $this->dictionary->setQueryFields('get_rows',$this->dictionary()->getListFields());
     
     if(method_exists($this->dictionary(),'getSortColumn') && $sc=$this->dictionary()->getSortColumn()){
     	$desc=false;
     	if($sc[0]=='-'){
     		$desc=true;$sc=substr($sc,1);
     	}
     	if($this->dictionary()->fieldExists($sc)){
     		$this->dictionary()->setOrder('get_rows',$sc,$desc);
     	}
     }
     
     $o=$o+$q->do_getAllHash();
     */
     // getRows do not support sorting, so we do ourselves.
     // This is to avoid changing getRows in the core, which would have much more severe
     // impact on the system!!
     // TODO: refactor during next major release
     $data = $this->dictionary()->getRows($this->dictionary()->getListFields());
     // f*****g good to sort in some certainly the-only-really-ever-needed order. yeah, in the core library.
     //usort($data,'usort_cmp');
     $o = $o + $data;
     foreach ($o as $row) {
         @($res[$row['id']] = isset($row['name']) ? $row['name'] : $row['id']);
     }
     return $res;
 }