src/Entity/CompanyAddress.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CompanyAddressRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=CompanyAddressRepository::class)
  8.  */
  9. class CompanyAddress
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      * @Assert\NotBlank
  20.      * @Assert\Length(
  21.      *      max = 255
  22.      * )
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\Column(type="string", length=50, nullable=true)
  27.      */
  28.     private $phone;
  29.     /**
  30.      * @ORM\Column(type="string", length=255)
  31.      * @Assert\NotBlank
  32.      * @Assert\Length(
  33.      *      max = 255
  34.      * )
  35.      */
  36.     private $address;
  37.     /**
  38.      * @ORM\Column(type="string", length=10)
  39.      * @Assert\NotBlank
  40.      * @Assert\Length(
  41.      *      max = 10
  42.      * )
  43.      */
  44.     private $zip_code;
  45.     /**
  46.      * El 050623 Lorenzo y Elvira solicitan que el campo qux_city sea un campo libre (no dependiente del campo aux_country) 
  47.      * 
  48.      * @ORM\Column(type="string", length=100)
  49.      * @Assert\NotBlank
  50.      * @Assert\Length(
  51.      *      max = 100
  52.      * )
  53.      */
  54.     private $city_name;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity=AuxCity::class)
  57.      */
  58.     private $city;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="companyAddresses")
  61.      * @ORM\JoinColumn(onDelete="CASCADE")
  62.      * @ORM\JoinColumn(nullable=false)
  63.      */
  64.     private $company;
  65.     /**
  66.      * @ORM\ManyToOne(targetEntity=AuxCountry::class)
  67.      * @ORM\JoinColumn(nullable=false)
  68.      */
  69.     private $country;
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getName(): ?string
  75.     {
  76.         return $this->name;
  77.     }
  78.     public function setName(string $name): self
  79.     {
  80.         $this->name $name;
  81.         return $this;
  82.     }
  83.     public function getPhone(): ?string
  84.     {
  85.         return $this->phone;
  86.     }
  87.     public function setPhone(string $phone): self
  88.     {
  89.         $this->phone $phone;
  90.         return $this;
  91.     }
  92.     public function getAddress(): ?string
  93.     {
  94.         return $this->address;
  95.     }
  96.     public function setAddress(string $address): self
  97.     {
  98.         $this->address $address;
  99.         return $this;
  100.     }
  101.     public function getZipCode(): ?string
  102.     {
  103.         return $this->zip_code;
  104.     }
  105.     public function setZipCode(string $zip_code): self
  106.     {
  107.         $this->zip_code $zip_code;
  108.         return $this;
  109.     }
  110.     public function getCityName(): ?string
  111.     {
  112.         return $this->city_name;
  113.     }
  114.     public function setCityName(string $city_name): self
  115.     {
  116.         $this->city_name $city_name;
  117.         return $this;
  118.     }
  119.     public function getCity(): ?AuxCity
  120.     {
  121.         return $this->city;
  122.     }
  123.     public function setCity(?AuxCity $city): self
  124.     {
  125.         $this->city $city;
  126.         return $this;
  127.     }
  128.     public function getCompany(): ?Company
  129.     {
  130.         return $this->company;
  131.     }
  132.     public function setCompany(?Company $company): self
  133.     {
  134.         $this->company $company;
  135.         return $this;
  136.     }
  137.     public function getCountry(): ?AuxCountry
  138.     {
  139.         return $this->country;
  140.     }
  141.     public function setCountry(?AuxCountry $country): self
  142.     {
  143.         $this->country $country;
  144.         return $this;
  145.     }
  146. }