Example #1
0
 public function load($id = null, $reset = true)
 {
     $found = parent::load($id);
     if (!method_exists($this, 'declareParamFields') && !method_exists($this, 'declareLangFields') || empty($this->id)) {
         return $found;
     }
     if (method_exists($this, 'declareParamFields')) {
         $fields = $this->declareParamFields();
         if (!empty($fields)) {
             foreach ($fields as $fieldname) {
                 $this->{$fieldname} = $this->getParams($fieldname);
             }
         }
     }
     return $found;
 }
Example #2
0
 public function load($id, $jsonfields = array())
 {
     if (method_exists($this, 'declareJSONfields')) {
         $jsonfields = array_merge($jsonfields, $this->declareJSONfields());
     }
     parent::load($id);
     if (!empty($jsonfields)) {
         foreach ($jsonfields as $fieldname) {
             $this->{$fieldname} = $this->getParams($fieldname);
         }
     }
     return true;
 }