<?php
namespace App\Entity\Profile;
use App\Entity\IProvidedService;
use App\Entity\Service;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\UniqueConstraint;
#[ORM\Table(name: 'profile_provided_services')]
#[UniqueConstraint(name: 'profile_service_unique', columns: ['profile_id', 'service_id'])]
#[ORM\Entity]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'profiles')]
class ProfileService implements IProvidedService
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
protected int $id;
#[ORM\JoinColumn(nullable: true)]
#[ORM\ManyToOne(targetEntity: Profile::class)]
protected ?Profile $profile;
#[ORM\JoinColumn(nullable: false)]
#[ORM\ManyToOne(targetEntity: Service::class)]
protected Service $service;
#[ORM\Column(name: 'service_condition', type: 'integer', nullable: true)]
protected ?int $condition;
#[ORM\Column(type: 'integer', nullable: true)]
protected ?int $extraCharge;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
protected ?string $comment;
public function __construct(?Profile $profile, Service $service, ?int $condition, ?int $extraCharge, ?string $comment = null)
{
$this->profile = $profile;
$this->service = $service;
$this->condition = $condition;
$this->extraCharge = $extraCharge;
$this->comment = $comment;
}
public function getId(): int
{
return $this->id;
}
public function getProfile(): Profile
{
return $this->profile;
}
public function setProfile(?Profile $profile): void
{
$this->profile = $profile;
}
public function clearEntity(): void
{
$this->profile = null;
}
public function getService(): Service
{
return $this->service;
}
public function setService(Service $service): void
{
$this->service = $service;
}
public function getCondition(): ?int
{
return $this->condition;
}
public function setCondition(?int $condition): void
{
$this->condition = $condition;
}
public function getExtraCharge(): ?int
{
return $this->extraCharge;
}
public function setExtraCharge(?int $extraCharge): void
{
$this->extraCharge = $extraCharge;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): void
{
$this->comment = $comment;
}
}