<?php
namespace App\Entity;
use App\Repository\CompanyAddressRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=CompanyAddressRepository::class)
*/
class CompanyAddress
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank
* @Assert\Length(
* max = 255
* )
*/
private $name;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank
* @Assert\Length(
* max = 255
* )
*/
private $address;
/**
* @ORM\Column(type="string", length=10)
* @Assert\NotBlank
* @Assert\Length(
* max = 10
* )
*/
private $zip_code;
/**
* El 050623 Lorenzo y Elvira solicitan que el campo qux_city sea un campo libre (no dependiente del campo aux_country)
*
* @ORM\Column(type="string", length=100)
* @Assert\NotBlank
* @Assert\Length(
* max = 100
* )
*/
private $city_name;
/**
* @ORM\ManyToOne(targetEntity=AuxCity::class)
*/
private $city;
/**
* @ORM\ManyToOne(targetEntity=Company::class, inversedBy="companyAddresses")
* @ORM\JoinColumn(onDelete="CASCADE")
* @ORM\JoinColumn(nullable=false)
*/
private $company;
/**
* @ORM\ManyToOne(targetEntity=AuxCountry::class)
* @ORM\JoinColumn(nullable=false)
*/
private $country;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getZipCode(): ?string
{
return $this->zip_code;
}
public function setZipCode(string $zip_code): self
{
$this->zip_code = $zip_code;
return $this;
}
public function getCityName(): ?string
{
return $this->city_name;
}
public function setCityName(string $city_name): self
{
$this->city_name = $city_name;
return $this;
}
public function getCity(): ?AuxCity
{
return $this->city;
}
public function setCity(?AuxCity $city): self
{
$this->city = $city;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
public function getCountry(): ?AuxCountry
{
return $this->country;
}
public function setCountry(?AuxCountry $country): self
{
$this->country = $country;
return $this;
}
}