コード例 #1
0
 public function afterIteration(array $list)
 {
     $_list = parent::afterIteration($list);
     $list = array();
     $id = $this->getProperty('res');
     $field = $this->getProperty('field');
     $debug = $this->getProperty('debug');
     // if we have data in dictionary
     if (count($_list) != 0) {
         $list = $_list;
         $item = current($list);
         if (empty($item[$field])) {
             if ($debug) {
                 $this->modx->log(xPDO::LOG_LEVEL_WARN, "Can't get field value from dictionary. Resource: " . $id . '-' . $field . '-' . $this->getOption('cultureKey'));
             }
             $list[$item['object_id']][$field] = $field;
         }
         // if we found that there is no data for resource
     } else {
         if ($debug) {
             $this->modx->log(xPDO::LOG_LEVEL_WARN, "Get native resource field value: " . $this->getProperty('res') . '-' . $this->getProperty('field'));
         }
         array_push($list, array('id' => $id, 'object_id' => $id, $this->getProperty('field') => $this->getNativeField()));
     }
     return $list;
 }
コード例 #2
0
 public function outputArray(array $array, $count = false)
 {
     //fix total
     $count = count($array);
     return parent::outputArray($array, $count);
 }