_query[$identification] = $query; return $this; } /** * @param string $identification * @return bool */ public function hasIdentification(string $identification): bool { return isset($this->_query[$identification]); } /** * @param string $name * @return ActiveQuery|null */ public function getQuery(string $name): ?ActiveQuery { return $this->_query[$name] ?? null; } /** * @param string $_identification * @return mixed * @throws */ public function first(string $_identification): mixed { if (!Context::exists($_identification)) { Context::set($_identification, $this->_query[$_identification]->first()); } return Context::get($_identification); } /** * @param string $_identification * @return mixed */ public function count(string $_identification): mixed { if (!Context::exists($_identification)) { Context::set($_identification, $this->_query[$_identification]->count()); } return Context::get($_identification); } /** * @param string $_identification * @return mixed * @throws */ public function get(string $_identification): mixed { if (Context::exists($_identification)) { Context::set($_identification, $this->_query[$_identification]->get()); } return Context::get($_identification); } }