src/Entity/System/State.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\System\StateRepository")
  6.  *
  7.  * @ORM\Table(name="ps_state", indexes={
  8.  *
  9.  *     @ORM\Index(name="name", columns={"name"})
  10.  * })
  11.  */
  12. class State
  13. {
  14.     public const DEFAULT_STATE_ID 0;
  15.     public const SPANISH_EXPORT_POST_CODE_PREFIX = [
  16.         self::LAS_PALMAS_POSTCODE,
  17.         self::TENERIFE_POSTCODE,
  18.         self::CEUTA_POSTCODE,
  19.         self::MELILLA_POSTCODE,
  20.     ];
  21.     public const LAS_PALMAS_POSTCODE 35;
  22.     public const TENERIFE_POSTCODE 38;
  23.     public const CEUTA_POSTCODE 51;
  24.     public const MELILLA_POSTCODE 52;
  25.     /**
  26.      * @var int
  27.      *
  28.      * @ORM\Id
  29.      *
  30.      * @ORM\GeneratedValue(strategy="AUTO")
  31.      *
  32.      * @ORM\Column(type="integer", name="id_state", length=10, options={"unsigned":true})
  33.      */
  34.     private $id;
  35.     /**
  36.      * @var Country
  37.      *
  38.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Country")
  39.      *
  40.      * @ORM\JoinColumn(name="id_country", referencedColumnName="id_country", nullable=false)
  41.      */
  42.     private $country;
  43.     /**
  44.      * @var Zone
  45.      *
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Zone")
  47.      *
  48.      * @ORM\JoinColumn(name="id_zone", referencedColumnName="id_zone", nullable=false)
  49.      */
  50.     private $zone;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(type="string", length=64, nullable=false)
  55.      */
  56.     private $name;
  57.     /**
  58.      * @var string
  59.      *
  60.      * @ORM\Column(type="string", length=7, nullable=false)
  61.      */
  62.     private $isoCode;
  63.     /**
  64.      * @var string
  65.      *
  66.      * @ORM\Column(type="string", length=2, nullable=false)
  67.      */
  68.     private $postcode;
  69.     /**
  70.      * @var bool
  71.      *
  72.      * @ORM\Column(type="boolean", nullable=false)
  73.      */
  74.     private $taxBehavior;
  75.     /**
  76.      * @var bool
  77.      *
  78.      * @ORM\Column(type="boolean", nullable=false)
  79.      */
  80.     private $active;
  81.     /**
  82.      * @ORM\Column(type="boolean", options={"default" : 0}, nullable=true)
  83.      */
  84.     private bool $withoutVat;
  85.     public function __construct()
  86.     {
  87.         $this->taxBehavior false;
  88.         $this->active false;
  89.     }
  90.     /**
  91.      * @return int
  92.      */
  93.     public function getId(): int
  94.     {
  95.         return $this->id;
  96.     }
  97.     /**
  98.      * @param int $id
  99.      *
  100.      * @return State
  101.      */
  102.     public function setId(int $id): State
  103.     {
  104.         $this->id $id;
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Country
  109.      */
  110.     public function getCountry(): Country
  111.     {
  112.         return $this->country;
  113.     }
  114.     /**
  115.      * @param Country $country
  116.      *
  117.      * @return State
  118.      */
  119.     public function setCountry(Country $country): State
  120.     {
  121.         $this->country $country;
  122.         return $this;
  123.     }
  124.     /**
  125.      * @return Zone
  126.      */
  127.     public function getZone(): Zone
  128.     {
  129.         return $this->zone;
  130.     }
  131.     /**
  132.      * @param Zone $zone
  133.      *
  134.      * @return State
  135.      */
  136.     public function setZone(Zone $zone): State
  137.     {
  138.         $this->zone $zone;
  139.         return $this;
  140.     }
  141.     /**
  142.      * @return string
  143.      */
  144.     public function getName(): string
  145.     {
  146.         return $this->name;
  147.     }
  148.     /**
  149.      * @param string $name
  150.      *
  151.      * @return State
  152.      */
  153.     public function setName(string $name): State
  154.     {
  155.         $this->name $name;
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return string
  160.      */
  161.     public function getIsoCode(): string
  162.     {
  163.         return $this->isoCode;
  164.     }
  165.     /**
  166.      * @param string $isoCode
  167.      *
  168.      * @return State
  169.      */
  170.     public function setIsoCode(string $isoCode): State
  171.     {
  172.         $this->isoCode $isoCode;
  173.         return $this;
  174.     }
  175.     /**
  176.      * @return string
  177.      */
  178.     public function getPostcode(): string
  179.     {
  180.         return $this->postcode;
  181.     }
  182.     /**
  183.      * @param string $postcode
  184.      *
  185.      * @return State
  186.      */
  187.     public function setPostcode(string $postcode): State
  188.     {
  189.         $this->postcode $postcode;
  190.         return $this;
  191.     }
  192.     /**
  193.      * @return bool
  194.      */
  195.     public function isTaxBehavior(): bool
  196.     {
  197.         return $this->taxBehavior;
  198.     }
  199.     /**
  200.      * @param bool $taxBehavior
  201.      *
  202.      * @return State
  203.      */
  204.     public function setTaxBehavior(bool $taxBehavior): State
  205.     {
  206.         $this->taxBehavior $taxBehavior;
  207.         return $this;
  208.     }
  209.     /**
  210.      * @return bool
  211.      */
  212.     public function isActive(): bool
  213.     {
  214.         return $this->active;
  215.     }
  216.     /**
  217.      * @param bool $active
  218.      *
  219.      * @return State
  220.      */
  221.     public function setActive(bool $active): State
  222.     {
  223.         $this->active $active;
  224.         return $this;
  225.     }
  226.     public function isWithoutVat(): bool
  227.     {
  228.         return $this->withoutVat;
  229.     }
  230.     public function setWithoutVat(bool $withoutVat): State
  231.     {
  232.         $this->withoutVat $withoutVat;
  233.         return $this;
  234.     }
  235. }