src/Entity/Purchasing/Flow.php line 19
<?php
namespace App\Entity\Purchasing;
use App\Entity\Common as Common;
use App\Entity\Common\Company;
use App\Entity\Sales\Contract;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Table(name: 'purchasing_flow')]
#[ORM\Index(columns: ['client_id'], name: 'purchasing_flow_client_id_idx')]
#[ORM\Index(columns: ['contract_id'], name: 'purchasing_flow_contract_id_idx')]
#[ORM\UniqueConstraint(name: 'purchasing_flow_client_id_label_key', columns: ['client_id', 'label'])]
#[ORM\Entity]
#[UniqueEntity(fields: ['client', 'label'])]
class Flow
{
use Common\Blameable;
use Common\Trackable;
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\SequenceGenerator(sequenceName: 'purchasing_flow_id_seq')]
#[ORM\Column(type: Types::INTEGER)]
private ?int $id = null;
#[Assert\NotNull]
#[ORM\ManyToOne(targetEntity: Company::class)]
#[ORM\JoinColumn(name: 'client_id', nullable: false)]
private ?Company $client = null;
#[ORM\ManyToOne(targetEntity: Contract::class)]
#[ORM\JoinColumn(name: 'contract_id')]
private ?Contract $contract = null;
#[Assert\NotNull]
#[ORM\Column(type: Types::STRING)]
private ?string $label = null;
public function getId(): ?int
{
return $this->id;
}
public function getClient(): ?Company
{
return $this->client;
}
public function setClient(?Company $client): self
{
$this->client = $client;
return $this;
}
public function getContract(): ?Contract
{
return $this->contract;
}
public function setContract(?Contract $contract): self
{
$this->contract = $contract;
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
}