src/Entity/Purchasing/Flow.php line 19

  1. <?php
  2. namespace App\Entity\Purchasing;
  3. use App\Entity\Common as Common;
  4. use App\Entity\Common\Company;
  5. use App\Entity\Sales\Contract;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. #[ORM\Table(name'purchasing_flow')]
  11. #[ORM\Index(columns: ['client_id'], name'purchasing_flow_client_id_idx')]
  12. #[ORM\Index(columns: ['contract_id'], name'purchasing_flow_contract_id_idx')]
  13. #[ORM\UniqueConstraint(name'purchasing_flow_client_id_label_key'columns: ['client_id''label'])]
  14. #[ORM\Entity]
  15. #[UniqueEntity(fields: ['client''label'])]
  16. class Flow
  17. {
  18.     use Common\Blameable;
  19.     use Common\Trackable;
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  22.     #[ORM\SequenceGenerator(sequenceName'purchasing_flow_id_seq')]
  23.     #[ORM\Column(typeTypes::INTEGER)]
  24.     private ?int $id null;
  25.     #[Assert\NotNull]
  26.     #[ORM\ManyToOne(targetEntityCompany::class)]
  27.     #[ORM\JoinColumn(name'client_id'nullablefalse)]
  28.     private ?Company $client null;
  29.     #[ORM\ManyToOne(targetEntityContract::class)]
  30.     #[ORM\JoinColumn(name'contract_id')]
  31.     private ?Contract $contract null;
  32.     #[Assert\NotNull]
  33.     #[ORM\Column(typeTypes::STRING)]
  34.     private ?string $label null;
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getClient(): ?Company
  40.     {
  41.         return $this->client;
  42.     }
  43.     public function setClient(?Company $client): self
  44.     {
  45.         $this->client $client;
  46.         return $this;
  47.     }
  48.     public function getContract(): ?Contract
  49.     {
  50.         return $this->contract;
  51.     }
  52.     public function setContract(?Contract $contract): self
  53.     {
  54.         $this->contract $contract;
  55.         return $this;
  56.     }
  57.     public function getLabel(): ?string
  58.     {
  59.         return $this->label;
  60.     }
  61.     public function setLabel(string $label): self
  62.     {
  63.         $this->label $label;
  64.         return $this;
  65.     }
  66. }