src/Entity/CspCountry.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use App\Repository\CspCountryRepository;
  7. /**
  8.  * CspCountry
  9.  *
  10.  * @ORM\Table(name="csp_country", indexes={@ORM\Index(name="countryID", columns={"country_id"}), @ORM\Index(name="csp_id", columns={"csp_id"})})
  11.  * @ORM\Entity(repositoryClass=CspCountryRepository::class)
  12.  * @ORM\HasLifecycleCallbacks()
  13.  */
  14. class CspCountry
  15. {
  16.     public const SERIALIZATION_GROUP_COUNTRIES_PER_CSP 'countries_per_csp';
  17.     public const SERIALIZATION_GROUP_GET_ITEM 'csp_country_item';
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id", type="integer", nullable=false)
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="IDENTITY")
  24.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  25.      */
  26.     private $id;
  27.     /**
  28.      * @var Csp
  29.      *
  30.      * @ORM\ManyToOne(targetEntity="Csp", inversedBy="country")
  31.      * @ORM\JoinColumns({
  32.      *   @ORM\JoinColumn(name="csp_id", referencedColumnName="id")
  33.      * })
  34.      */
  35.     private $csp;
  36.     /**
  37.      * @var Country
  38.      *
  39.      * @ORM\ManyToOne(targetEntity="Country")
  40.      * @ORM\JoinColumns({
  41.      *   @ORM\JoinColumn(name="country_id", referencedColumnName="id")
  42.      * })
  43.      * @Groups({self::SERIALIZATION_GROUP_COUNTRIES_PER_CSP, self::SERIALIZATION_GROUP_GET_ITEM})
  44.      */
  45.     private $country;
  46.     /**
  47.      * @var string|null
  48.      *
  49.      * @ORM\Column(name="phone", type="string", length=100, nullable=true, options={"default"="NULL"})
  50.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  51.      */
  52.     private $phone null;
  53.     /**
  54.      * @var string|null
  55.      *
  56.      * @ORM\Column(name="email_format", type="string", length=90, nullable=true, options={"default"="NULL"})
  57.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  58.      */
  59.     private $emailFormat null;
  60.     /**
  61.      * @var string|null
  62.      *
  63.      * @ORM\Column(name="website", type="string", length=100, nullable=true, options={"default"="NULL"})
  64.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  65.      */
  66.     private $website null;
  67.     /**
  68.      * @var string|null
  69.      *
  70.      * @ORM\Column(name="wikipedia", type="string", length=100, nullable=true, options={"default"="NULL"})
  71.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  72.      */
  73.     private $wikipedia null;
  74.     /**
  75.      * @var bool
  76.      *
  77.      * @ORM\Column(name="valid_switchboard", type="boolean", nullable=false)
  78.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  79.      */
  80.     private $validSwitchboard false;
  81.     /**
  82.      * @var int|null
  83.      *
  84.      * @ORM\Column(name="method_1", type="smallint", nullable=true, options={"default"="NULL"})
  85.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  86.      */
  87.     private $method1 null;
  88.     /**
  89.      * @var int|null
  90.      *
  91.      * @ORM\Column(name="method_2", type="smallint", nullable=true, options={"default"="NULL"})
  92.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  93.      */
  94.     private $method2 null;
  95.     /**
  96.      * @var string|null
  97.      *
  98.      * @ORM\Column(name="domain", type="string", length=60, nullable=true, options={"default"="NULL"})
  99.      * @Groups({self::SERIALIZATION_GROUP_GET_ITEM})
  100.      */
  101.     private $domain null;
  102.     /**
  103.      * @var \DateTime|null
  104.      *
  105.      * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"default"="NULL"})
  106.      */
  107.     private $updatedAt null;
  108.     public function getId(): ?int
  109.     {
  110.         return $this->id;
  111.     }
  112.     public function getPhone(): ?string
  113.     {
  114.         return $this->phone;
  115.     }
  116.     public function setPhone(?string $phone): self
  117.     {
  118.         $this->phone $phone;
  119.         return $this;
  120.     }
  121.     public function getEmailFormat(): ?string
  122.     {
  123.         return $this->emailFormat;
  124.     }
  125.     public function setEmailFormat(?string $emailFormat): self
  126.     {
  127.         $this->emailFormat $emailFormat;
  128.         return $this;
  129.     }
  130.     public function getWebsite(): ?string
  131.     {
  132.         return $this->website;
  133.     }
  134.     public function setWebsite(?string $website): self
  135.     {
  136.         $this->website $website;
  137.         return $this;
  138.     }
  139.     public function getWikipedia(): ?string
  140.     {
  141.         return $this->wikipedia;
  142.     }
  143.     public function setWikipedia(?string $wikipedia): self
  144.     {
  145.         $this->wikipedia $wikipedia;
  146.         return $this;
  147.     }
  148.     public function isValidSwitchboard(): ?bool
  149.     {
  150.         return $this->validSwitchboard;
  151.     }
  152.     public function setValidSwitchboard(bool $validSwitchboard): self
  153.     {
  154.         $this->validSwitchboard $validSwitchboard;
  155.         return $this;
  156.     }
  157.     public function getMethod1(): ?int
  158.     {
  159.         return $this->method1;
  160.     }
  161.     public function setMethod1(?int $method1): self
  162.     {
  163.         $this->method1 $method1;
  164.         return $this;
  165.     }
  166.     public function getMethod2(): ?int
  167.     {
  168.         return $this->method2;
  169.     }
  170.     public function setMethod2(?int $method2): self
  171.     {
  172.         $this->method2 $method2;
  173.         return $this;
  174.     }
  175.     public function getDomain(): ?string
  176.     {
  177.         return $this->domain;
  178.     }
  179.     public function setDomain(?string $domain): self
  180.     {
  181.         $this->domain $domain;
  182.         return $this;
  183.     }
  184.     public function getUpdatedAt(): ?\DateTimeInterface
  185.     {
  186.         return $this->updatedAt;
  187.     }
  188.     
  189.     /**
  190.      * @ORM\PreUpdate
  191.      */
  192.     public function setUpdatedAt(): self
  193.     {
  194.         $this->updatedAt = new \DateTimeImmutable();
  195.         return $this;
  196.     }
  197.     public function getCsp(): ?Csp
  198.     {
  199.         return $this->csp;
  200.     }
  201.     public function setCsp(?Csp $csp): self
  202.     {
  203.         $this->csp $csp;
  204.         return $this;
  205.     }
  206.     public function getCountry(): ?Country
  207.     {
  208.         return $this->country;
  209.     }
  210.     public function setCountry(?Country $country): self
  211.     {
  212.         $this->country $country;
  213.         return $this;
  214.     }
  215. }