getClassName(); } public function getModelClass(): string { return Model::class; } public function getEntityClass(): string { return Entity::class; } public function getEntitiesForLineUp(): array { $this->getModel()->whereNotIn("process", DBMS_GEARLIST_PROCESS_TYPES); $this->getModel()->whereNotIn("cpuname", DBMS_GEARLIST_CPU_TYPES); $this->getModel()->orderBy(["process" => "ASC", "price" => "ASC", "cpuname" => "asc"]); return $this->getEntities(); } public function getCountByMode(string $mode, string $cpu, ?string $spec = null): int { switch ($mode) { case 'all': $this->getModel()->like(["server_cpuname" => "%$cpu%", "server_spec" => "%$spec%"]); break; case 'use': $this->getModel()->where("server_use_status", "n"); $this->getModel()->like(["server_cpuname" => "%$cpu%", "server_spec" => "%$spec%"]); break; case 'empty': $this->getModel()->where("server_use_status", "y"); $this->getModel()->like(["server_cpuname" => "%$cpu%", "server_spec" => "%$spec%"]); break; case 'format': $this->getModel()->where("server_use_status", "y"); $this->getModel()->where("server_fomat_date !='NULL'"); $this->getModel()->like(["server_cpuname" => "%$cpu%"]); break; default: throw new \InvalidArgumentException("Invalid mode: $mode"); } return $this->getCount(); } }