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