/** * Call a method * * @param string $method to call * @param mixed $args arguments to send * * @return method return */ public function __call($method, $args) { if (!$this->_cls) { return null; } $cls = $this->_cls; $conditions = Model::getScope($method, $cls); if (!$conditions) { return $this; } if (is_callable($conditions)) { $conditions = $conditions($args); } $this->_builder->where .= " and {$conditions}"; return $this; }