src/Entity/Profile/ProfileService.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Profile;
  3. use App\Entity\IProvidedService;
  4. use App\Entity\Service;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\ORM\Mapping\UniqueConstraint;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. #[ORM\Table(name'profile_provided_services')]
  9. #[UniqueConstraint(name'profile_service_unique'columns: ['profile_id''service_id'])]
  10. #[ORM\Entity]
  11. #[ORM\Cache(usage'NONSTRICT_READ_WRITE'region'profiles')]
  12. class ProfileService implements IProvidedService
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue(strategy'AUTO')]
  16.     #[ORM\Column(type'integer')]
  17.     protected int $id;
  18.     #[ORM\JoinColumn(nullabletrue)]
  19.     #[ORM\ManyToOne(targetEntityProfile::class)]
  20.     protected ?Profile $profile;
  21.     #[ORM\JoinColumn(nullablefalse)]
  22.     #[ORM\ManyToOne(targetEntityService::class)]
  23.     #[Groups(['preview''listing'])]
  24.     protected Service $service;
  25.     #[ORM\Column(name'service_condition'type'integer'nullabletrue)]
  26.     #[Groups(['preview''listing'])]
  27.     protected ?int $condition;
  28.     #[ORM\Column(type'integer'nullabletrue)]
  29.     #[Groups(['preview''listing'])]
  30.     protected ?int $extraCharge;
  31.     #[ORM\Column(type'string'length255nullabletrue)]
  32.     #[Groups(['preview''listing'])]
  33.     protected ?string $comment;
  34.     public function __construct(?Profile $profileService $service, ?int $condition, ?int $extraCharge, ?string $comment null)
  35.     {
  36.         $this->profile $profile;
  37.         $this->service $service;
  38.         $this->condition $condition;
  39.         $this->extraCharge $extraCharge;
  40.         $this->comment $comment;
  41.     }
  42.     public function getId(): int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getProfile(): Profile
  47.     {
  48.         return $this->profile;
  49.     }
  50.     public function setProfile(?Profile $profile): void
  51.     {
  52.         $this->profile $profile;
  53.     }
  54.     public function clearEntity(): void
  55.     {
  56.         $this->profile null;
  57.     }
  58.     public function getService(): Service
  59.     {
  60.         return $this->service;
  61.     }
  62.     public function setService(Service $service): void
  63.     {
  64.         $this->service $service;
  65.     }
  66.     public function getCondition(): ?int
  67.     {
  68.         return $this->condition;
  69.     }
  70.     public function setCondition(?int $condition): void
  71.     {
  72.         $this->condition $condition;
  73.     }
  74.     public function getExtraCharge(): ?int
  75.     {
  76.         return $this->extraCharge;
  77.     }
  78.     public function setExtraCharge(?int $extraCharge): void
  79.     {
  80.         $this->extraCharge $extraCharge;
  81.     }
  82.     public function getComment(): ?string
  83.     {
  84.         return $this->comment;
  85.     }
  86.     public function setComment(?string $comment): void
  87.     {
  88.         $this->comment $comment;
  89.     }
  90. }