Пример #1
0
 public function toArrayTV($render = false)
 {
     $out = array_diff_key(parent::toArray(), $this->default_field);
     $tpl = $this->get('template');
     $tvTPL = APIHelpers::getkey($this->tvTpl, $tpl, array());
     foreach ($tvTPL as $item) {
         if (isset($this->tvid[$item]) && !array_key_exists($this->tvid[$item], $out)) {
             $out[$this->tvid[$item]] = $this->get($this->tvid[$item]);
         }
     }
     if ($render) {
         foreach ($out as $key => $val) {
             $out[$key] = $this->renderTV($key);
         }
     }
     return $out;
 }