hydrateexception($datas); } public function init(string $id, string $route, string $query, array $params = [], string $icon = '⭐') { $this->setid($id); $this->setroute($route); $this->setquery($query); $this->setparams($params); $this->seticon($icon); } // _____________________________ G E T __________________________________ public function id() { return $this->id; } public function query() { return $this->query; } public function route() { return $this->route; } public function params() { return $this->params; } public function icon() { return $this->icon; } // _____________________________ S E T __________________________________ public function setid($id): bool { if (is_string($id)) { $id = idclean($id); if (!empty($id)) { $this->id = $id; return true; } } return false; } public function setquery($query) { if (is_string($query)) { $this->query = substr($query, 0, Model::MAX_QUERY_LENGH); } } public function setroute($route) { if ($route === 'home' || $route === 'media') { $this->route = $route; return true; } else { return false; } } public function setparams($params) { if (is_array($params)) { $this->params = $params; } } public function seticon($icon) { if (is_string($icon)) { $this->icon = substr(strip_tags($icon), 0, 16); } } }