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; }
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; }