/** * __call * * Allows dynamic methods getXxx, setXxx, hasXxx, addXxx or clearXxx. * * @access public * @throws ModelException if method does not exist. * @param mixed $method * @param mixed $arguments * @return mixed */ public function __call($method, $arguments) { list($operation, $attribute) = $this->extractMethodName($method); foreach ($this->dockets as $docket) { if (strtolower($docket['name']) === strtolower($attribute)) { switch ($operation) { case 'get': return $docket; default: throw new ModelException(sprintf('No such method "%s:%s()"', get_class($this), $method)); } } } return parent::__call($method, $arguments); }
public function __construct(array $values = []) { $this->set('chu', true); parent::__construct($values); }
/** * fillHasMethods * * When getIterator is called the first time, the list of "has" methods is * set in a static attribute to boost performances. * * @access protected * @param FlexibleEntity $entity * @return null */ protected static function fillHasMethods(FlexibleEntity $entity) { parent::fillHasMethods($entity); static::$has_methods = array_filter(static::$has_methods, function ($e) { return $e !== 'Role'; }); }