src/AtechNet/CoreBundle/Entity/ClaimError.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping\Column;
  4. use Doctrine\ORM\Mapping\Entity;
  5. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  6. use Doctrine\ORM\Mapping\JoinColumn;
  7. use Doctrine\ORM\Mapping\ManyToOne;
  8. use Doctrine\ORM\Mapping\Table as Table;
  9. /**
  10.  * ClaimError
  11.  *
  12.  * @Table(name="claim_errors")
  13.  * @Entity()
  14.  * @HasLifecycleCallbacks
  15.  */
  16. class ClaimError extends AbstractSignedEntity
  17. {
  18.     public const int ERROR_TYPE_RAM = 1;
  19.     public const int ERROR_TYPE_SSD = 2;
  20.     public const int ERROR_TYPE_LCD = 3;
  21.     public const int ERROR_TYPE_KEYBOARD = 4;
  22.     public const int ERROR_TYPE_BROKEN = 5;
  23.     public const int ERROR_TYPE_BATTERY = 6;
  24.     public const int ERROR_TYPE_MAINBOARD = 7;
  25.     public const int ERROR_TYPE_SW = 8;
  26.     public const int ERROR_TYPE_ADAPTER = 9;
  27.     public const int ERROR_TYPE_FAN = 10;
  28.     public const int ERROR_TYPE_USER_ERROR = 11;
  29.     public const int ERROR_TYPE_CMOS_BATTERY = 12;
  30.     public const int ERROR_TYPE_SOUND = 13;
  31.     public const int ERROR_TYPE_TOUCHPAD = 14;
  32.     public const int ERROR_TYPE_PARCEL_SERVICE = 15;
  33.     public const int ERROR_TYPE_SALES = 16;
  34.     public const int ERROR_TYPE_COVER = 17;
  35.     public const int ERROR_TYPE_DOMAIN_ICLOCK_LOCK = 18;
  36.     public const int ERROR_TYPE_DOCK = 19;
  37.     public const int ERROR_TYPE_MONITOR = 20;
  38.     public const int ERROR_TYPE_WIFI_BLUETOOTH = 21;
  39.     public const int ERROR_TYPE_OTHER = 22;
  40.     public const int ERROR_TYPE_KEYBOARD_BACKLIGHT = 23;
  41.      public const int ERROR_TYPE_OVERHEATING = 24;
  42.      public const int ERROR_TYPE_WEBCAM = 25;
  43.      public const int ERROR_TYPE_PORT_ERROR = 26;
  44.      public const int ERROR_TYPE_MARKETPLACE = 27;
  45.     public const int ERROR_TYPE_STYLUS_PEN = 28;
  46.     public const int ERROR_STATE_SERVICE = 1;
  47.     public const int ERROR_STATE_USER = 2;
  48.     public const int ERROR_STATE_PRODUCTION = 3;
  49.     public const int ERROR_STATE_SALES = 4;
  50.     public const int ERROR_STATE_MALFUNCTIONING_PRODUCT = 5;
  51.     public const int ERROR_STATE_PACKAGING = 6;
  52.     public const int ERROR_STATE_INSTALLATION = 7;
  53.     public const int ERROR_STATE_CONFIG = 8;
  54.     public const int ERROR_STATE_KEYBOARD = 9;
  55.     public const int ERROR_STATE_CARBON = 10;
  56.     public const int ERROR_STATE_AIKEN = 11;
  57.     public const int ERROR_STATE_OTHER = 12;
  58.     public const int USER_ERROR_STATE_GRADE = 13;
  59.     public const int USER_ERROR_STATE_FUNCTION = 14;
  60.     public const int USER_ERROR_STATE_WRONG_ORDER = 15;
  61.     public const int USER_ERROR_STATE_NOT_PROVIDED = 16;
  62.     public const int ERROR_STATE_SALES_RISK = 17;
  63.     public const int ERROR_STATE_QUALITY = 18;
  64.     public const int ERROR_STATE_NOT_SUITABLE_FOR_MARKET = 19;
  65.     public const int ERROR_STATE_NEW_BATTERY = 20;
  66.     public const int ERROR_STATE_PRESUMABLY = 21;
  67.     public const int ERROR_STATE_THERMAL_PASTE_APPLIED = 22;
  68.     /**
  69.      * @var Claim
  70.      *
  71.      * @ManyToOne(targetEntity="Claim", inversedBy="errors")
  72.      * @JoinColumn(name="claim_id", referencedColumnName="id")
  73.      */
  74.     private $claim;
  75.     /**
  76.      * @var int
  77.      *
  78.      * @Column(name="error_type", type="integer")
  79.      */
  80.     private $errorType;
  81.     /**
  82.      * @var int
  83.      *
  84.      * @Column(name="error_state", type="integer")
  85.      */
  86.     private $errorState;
  87.     /**
  88.      * @return array
  89.      */
  90.     public static function getErrorTypes(): array
  91.     {
  92.         return [
  93.             self::ERROR_TYPE_RAM                => 'RAM',
  94.             self::ERROR_TYPE_SSD                => 'SSD',
  95.             self::ERROR_TYPE_LCD                => 'LCD',
  96.             self::ERROR_TYPE_KEYBOARD           => 'Keyboard',
  97.             self::ERROR_TYPE_KEYBOARD_BACKLIGHT => 'Keyboard backlight',
  98.             self::ERROR_TYPE_TOUCHPAD           => 'Touchpad',
  99.             self::ERROR_TYPE_SALES              => 'Sales',
  100.             self::ERROR_TYPE_BATTERY            => 'Battery',
  101.             self::ERROR_TYPE_MAINBOARD          => 'Mainboard',
  102.             self::ERROR_TYPE_SW                 => 'SW error',
  103.             self::ERROR_TYPE_ADAPTER            => 'Adapter/Power source',
  104.             self::ERROR_TYPE_FAN                => 'Fan',
  105.             self::ERROR_TYPE_CMOS_BATTERY       => 'CMOS battery',
  106.             self::ERROR_TYPE_SOUND              => 'SOUND',
  107.             self::ERROR_TYPE_PARCEL_SERVICE     => 'Parcel service',
  108.             self::ERROR_TYPE_USER_ERROR         => 'User error',
  109.             self::ERROR_TYPE_COVER              => 'Cover',
  110.             self::ERROR_TYPE_DOMAIN_ICLOCK_LOCK => 'Domain - iCloud lock',
  111.             self::ERROR_TYPE_DOCK               => 'Dock',
  112.             self::ERROR_TYPE_MONITOR            => 'Monitor',
  113.             self::ERROR_TYPE_WIFI_BLUETOOTH     => 'Wifi + Bluetooth',
  114.             self::ERROR_TYPE_OTHER              => 'Other',
  115.             self::ERROR_TYPE_OVERHEATING        => 'Overheating',
  116.             self::ERROR_TYPE_WEBCAM             => 'Webcam',
  117.             self::ERROR_TYPE_PORT_ERROR         => 'Port error',
  118.             self::ERROR_TYPE_MARKETPLACE        => 'Marketplace',
  119.             self::ERROR_TYPE_STYLUS_PEN         => 'Stylus Pen'
  120.         ];
  121.     }
  122.     /**
  123.      * @param bool $includeProduction
  124.      * @return array
  125.      */
  126.     public static function getErrorStates(bool $includeProduction = false): array
  127.     {
  128.         $errorStates = [
  129.             self::ERROR_STATE_SERVICE                 => 'Parcel service',
  130.             self::ERROR_STATE_USER                    => 'User',
  131.             self::ERROR_STATE_PRODUCTION              => 'Production',
  132.             self::ERROR_STATE_SALES                   => 'Sales',
  133.             self::ERROR_STATE_SALES_RISK              => 'Sales - Risk',
  134.             self::ERROR_STATE_MALFUNCTIONING_PRODUCT  => 'Malfunctioning product',
  135.             self::ERROR_STATE_PACKAGING               => 'Production - Packaging',
  136.             self::ERROR_STATE_INSTALLATION            => 'Production - Installation',
  137.             self::ERROR_STATE_CONFIG                  => 'Production - Config',
  138.             self::ERROR_STATE_KEYBOARD                => 'Production - Keyboard',
  139.             self::ERROR_STATE_CARBON                  => 'Production - Carbon',
  140.             self::ERROR_STATE_AIKEN                   => 'Production - Aiken',
  141.             self::ERROR_STATE_QUALITY                 => 'Production - Quality',
  142.             self::ERROR_STATE_OTHER                   => 'Production - Other',
  143.             self::ERROR_STATE_NOT_SUITABLE_FOR_MARKET => 'A piacnak nem felel meg',
  144.             self::ERROR_STATE_NEW_BATTERY             => 'New Battery',
  145.             self::ERROR_STATE_PRESUMABLY              => 'Feltételezhetően',
  146.             self::ERROR_STATE_THERMAL_PASTE_APPLIED   => 'Pasztázott',
  147.         ];
  148.         if (!$includeProduction) {
  149.             unset($errorStates[self::ERROR_STATE_PRODUCTION]);
  150.         }
  151.         return $errorStates;
  152.     }
  153.     public static function getUserErrorStates(): array
  154.     {
  155.         return [
  156.             self::USER_ERROR_STATE_GRADE        => 'Grade',
  157.             self::USER_ERROR_STATE_FUNCTION     => 'Function',
  158.             self::USER_ERROR_STATE_WRONG_ORDER  => 'Wrong order',
  159.             self::USER_ERROR_STATE_NOT_PROVIDED => 'Not provided',
  160.         ];
  161.     }
  162.     /**
  163.      * @return Claim
  164.      */
  165.     public function getClaim(): Claim
  166.     {
  167.         return $this->claim;
  168.     }
  169.     /**
  170.      * @param Claim $claim
  171.      */
  172.     public function setClaim(Claim $claim)
  173.     {
  174.         $this->claim = $claim;
  175.     }
  176.     /**
  177.      * @return int
  178.      */
  179.     public function getErrorType(): int
  180.     {
  181.         return $this->errorType;
  182.     }
  183.     /**
  184.      * @param int $errorType
  185.      */
  186.     public function setErrorType(int $errorType)
  187.     {
  188.         $this->errorType = $errorType;
  189.     }
  190.     /**
  191.      * @return int
  192.      */
  193.     public function getErrorState(): int
  194.     {
  195.         return $this->errorState;
  196.     }
  197.     /**
  198.      * @param int $errorState
  199.      */
  200.     public function setErrorState(int $errorState)
  201.     {
  202.         $this->errorState = $errorState;
  203.     }
  204. }