<?php
namespace App\Entity;
use App\Validator\Constraint as AppAssert;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*
* @ORM\Table(
* name="recurrent_job_additional_zipcodes",
* uniqueConstraints={@ORM\UniqueConstraint(name="recurrent_jobs_id_zipcode_idx", columns={"recurrent_jobs_id", "zipcode"})}
* )
*/
class RecurrentJobAdditionalZipcode
{
public function __construct(RecurrentJob $recurrentJob, string $zipcode)
{
$this->recurrentJob = $recurrentJob;
$this->zipcode = $zipcode;
}
/**
* @var RecurrentJob
*
* @ORM\Id
*
* @ORM\ManyToOne(targetEntity="App\Entity\RecurrentJob", inversedBy="additionalZipcodes", cascade={"persist"})
*
* @ORM\JoinColumn(name="recurrent_jobs_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
private $recurrentJob;
/**
* @var string
*
* @ORM\Id
*
* @ORM\Column(name="zipcode", type="string", length=128, nullable=false)
*
* @AppAssert\KnownZipcode
*/
private $zipcode;
public function getZipcode(): string
{
return $this->zipcode;
}
}