src/Entity/JobWorker.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\JobWorkerRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use ApiPlatform\Metadata\ApiFilter;
  8. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. use Symfony\Component\Serializer\Annotation\MaxDepth;
  11. use ApiPlatform\Core\Annotation\ApiProperty;
  12. #[ORM\Entity(repositoryClassJobWorkerRepository::class)]
  13. #[ApiResource(
  14.     normalizationContext: ['groups' => ['job_woker:read']],
  15.     denormalizationContext: ['groups' => ['job_woker:write']],
  16.     order: ['id' => 'DESC'],
  17. )]
  18. class JobWorker
  19. {
  20.     #[Groups(['job_woker:read''job_woker:write''job:read''job:write''worker:read''worker:write''account_worker:read''account:read''read''account:write', ])]
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column]
  24.     private ?int $id null;
  25.     #[Groups(['job_woker:read''job_woker:write''worker:read''worker:write''account_worker:read''account:read''read''account:write', ])]
  26.     #[ORM\ManyToOne(inversedBy'jobWorkers')]
  27.     private ?Jobs $job null;
  28.     #[Groups(['job_woker:read''job_woker:write''job:read''job:write''account:read''read''account:write', ])]
  29.     #[ORM\ManyToOne(inversedBy'jobWorkers')]
  30.     private ?Workers $worker null;
  31.     #[Groups(['job_woker:read''job_woker:write''job:read''job:write''worker:read''worker:write''account_worker:read''account:read''read''account:write', ])]
  32.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  33.     private ?string $description null;
  34.     #[Groups(['job_woker:read''job_woker:write''job:read''job:write''worker:read''worker:write''account_worker:read''account:read''read''account:write', ])]
  35.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  36.     private ?\DateTimeInterface $dateJob null;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getJob(): ?Jobs
  42.     {
  43.         return $this->job;
  44.     }
  45.     public function setJob(?Jobs $job): self
  46.     {
  47.         $this->job $job;
  48.         return $this;
  49.     }
  50.     public function getWorker(): ?Workers
  51.     {
  52.         return $this->worker;
  53.     }
  54.     public function setWorker(?Workers $worker): self
  55.     {
  56.         $this->worker $worker;
  57.         return $this;
  58.     }
  59.     public function getDescription(): ?string
  60.     {
  61.         return $this->description;
  62.     }
  63.     public function setDescription(?string $description): self
  64.     {
  65.         $this->description $description;
  66.         return $this;
  67.     }
  68.     public function getDateJob(): ?\DateTimeInterface
  69.     {
  70.         return $this->dateJob;
  71.     }
  72.     public function setDateJob(?\DateTimeInterface $dateJob): self
  73.     {
  74.         $this->dateJob $dateJob;
  75.         return $this;
  76.     }
  77. }