<?phpnamespace App\Entity\Gauge;use App\DBAL\EnumSupplierVisibilityType;use App\Entity\Client\Client;use App\Entity\Extension\TimestampableTrait;use App\Repository\Gauge\SupplierRepository;use DateTimeInterface;use Ramsey\Uuid\Uuid;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;use Ramsey\Uuid\UuidInterface;/** * @ORM\Entity(repositoryClass=SupplierRepository::class) * @ORM\Table(name="suppliers") */class Supplier{ use TimestampableTrait; /** * @var UuidInterface * * @ORM\Id() * @ORM\GeneratedValue(strategy="CUSTOM") * @ORM\Column(type="uuid", unique=true) * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") */ private UuidInterface $id; /** * @var string * @ORM\Column(type="string") * * @Assert\NotBlank * @Assert\Type(type="string") */ private string $name; /** * @var bool * @ORM\Column(type="boolean") * * @Assert\NotNull * @Assert\Type(type="boolean") */ private bool $water = false; /** * @var bool * @ORM\Column(type="boolean") * * @Assert\NotNull * @Assert\Type(type="boolean") */ private bool $electricity = false; /** * @var bool * @ORM\Column(type="boolean") * * @Assert\NotNull * @Assert\Type(type="boolean") */ private bool $gas = false; /** * @var bool * @ORM\Column(type="boolean") * * @Assert\NotNull * @Assert\Type(type="boolean") */ private bool $heat = false; /** * @var bool * @ORM\Column(type="boolean") * * @Assert\NotNull * @Assert\Type(type="boolean") */ private bool $fuel = false; /** * @ORM\Column(type="enum_suppliervisibility", options={"default": EnumSupplierVisibilityType::VISIBLE_FOR_CLIENT}) */ private string $visibility = EnumSupplierVisibilityType::VISIBLE_FOR_CLIENT; /** * @var Client * @ORM\ManyToOne(targetEntity="App\Entity\Client\Client") * @ORM\JoinColumn(name="client_id", referencedColumnName="id", nullable=false) */ private Client $client; /** * @var int * @ORM\Column(type="integer") */ private int $usageCount = 0; /** * @var DateTimeInterface|null * * @ORM\Column(name="merged_at", type="datetime", nullable=true) */ protected ?DateTimeInterface $mergedAt; /** * @var ?string * @ORM\Column(type="string", nullable=true) * @Assert\Type(type="string") */ private ?string $mergedWith = null; /** * @return UuidInterface */ public function getId(): UuidInterface { return $this->id; } /** * @param UuidInterface $id * @return $this */ public function setId(UuidInterface $id): Supplier { $this->id = $id; return $this; } /** * @return string */ public function getName(): string { return $this->name; } /** * @param string $name * @return $this */ public function setName(string $name): Supplier { $this->name = $name; return $this; } /** * @return bool */ public function isWater(): bool { return $this->water; } /** * @param bool $water * @return $this */ public function setWater(bool $water): Supplier { $this->water = $water; return $this; } /** * @return bool */ public function isElectricity(): bool { return $this->electricity; } /** * @param bool $electricity * @return $this */ public function setElectricity(bool $electricity): Supplier { $this->electricity = $electricity; return $this; } /** * @return bool */ public function isGas(): bool { return $this->gas; } /** * @param bool $gas * @return $this */ public function setGas(bool $gas): Supplier { $this->gas = $gas; return $this; } /** * @return bool */ public function isHeat(): bool { return $this->heat; } /** * @param bool $heat * @return $this */ public function setHeat(bool $heat): Supplier { $this->heat = $heat; return $this; } /** * @return bool */ public function isFuel(): bool { return $this->fuel; } /** * @param bool $fuel * @return $this */ public function setFuel(bool $fuel): Supplier { $this->fuel = $fuel; return $this; } /** * @return int */ public function getVisibility(): int { return $this->visibility; } /** * @param int $visibility * @return $this */ public function setVisibility(int $visibility): Supplier { $this->visibility = $visibility; return $this; } /** * @return Client */ public function getClient(): Client { return $this->client; } /** * @param Client $client * @return $this */ public function setClient(Client $client): Supplier { $this->client = $client; return $this; } /** * @return int */ public function getUsageCount(): int { return $this->usageCount; } /** * @param int $usageCount * @return $this */ public function setUsageCount(int $usageCount): Supplier { $this->usageCount = $usageCount; return $this; } /** * @return DateTimeInterface|null */ public function getMergedAt(): ?DateTimeInterface { return $this->mergedAt; } /** * @param DateTimeInterface|null $mergedAt * @return $this */ public function setMergedAt(?DateTimeInterface $mergedAt): Supplier { $this->mergedAt = $mergedAt; return $this; } /** * @return string */ public function getMergedWith(): string { return $this->mergedWith; } /** * @param string $mergedWith * @return $this */ public function setMergedWith(string $mergedWith): Supplier { $this->mergedWith = $mergedWith; return $this; } /** * @return DateTimeInterface|null */ public function getCreatedAt(): ?DateTimeInterface { return $this->createdAt; } /** * @param DateTimeInterface|null $createdAt * @return $this */ public function setCreatedAt(?DateTimeInterface $createdAt): Supplier { $this->createdAt = $createdAt; return $this; } /** * @return DateTimeInterface|null */ public function getUpdatedAt(): ?DateTimeInterface { return $this->updatedAt; } /** * @param DateTimeInterface|null $updatedAt * @return $this */ public function setUpdatedAt(?DateTimeInterface $updatedAt): Supplier { $this->updatedAt = $updatedAt; return $this; }}