<?php

namespace lib\Services;

use lib\Entities\GearlistEntity as Entity;
use lib\Models\GearlistModel as Model;

class GearlistService extends CommonService
{
  public function __construct()
  {
    parent::__construct();
  }
  final public function getClassName(): string
  {
    return "Gearlist";
  }
  final public function getClassPath(): string
  {
    return $this->getClassName();
  }
  public function getModelClass(): string
  {
    return Model::class;
  }
  public function getEntityClass(): string
  {
    return Entity::class;
  }

  public function getLineUpEntities(): array
  {
    $this->getModel()->whereNotIn("process", [
      '',
      'COLOCATION',
      'XEON Single',
      'CUSTOM',
      'INS-일회성',
      'NEHALEM',
      'Cisco Router',
    ]);
    $this->getModel()->whereNotIn("cpuname", [
      '',
      'X6-Q',
      'C2800',
      'C2600',
      'COL',
      'CUS',
      'NX227',
      'NX20',
      'NX21',
      'DQ28',
      'DQ26',
      'DQ31',
      'DQ18',
      'DQ23',
      'DQ20',
      'DX34',
      'DX38',
      'DX28',
      'DX32',
      'DX36',
      'DX30',
      'MD32',
      'MD30',
      'Q16R',
      'Q316',
      'Q310',
      'Q283',
      'Q266',
      'Q25R',
      'Q213',
      'Q20R',
      'Q186',
      'Q24',
      'Q20',
      'Q240',
      'DX3',
      'DQ233'
    ]);
    $this->getModel()->orderBy(["process" => "ASC", "price" => "ASC", "cpuname" => "asc"]);
    return $this->getEntities();
  }
}
