src/Entity/CRM/OrderLicence.php line 10
<?phpnamespace App\Entity\CRM;use App\Repository\CRM\OrderLicenceRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: OrderLicenceRepository::class)]class OrderLicence{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255, nullable: true)]private ?string $licenseId = null;#[ORM\Column(length: 255, nullable: true)]private ?string $orderNumber = null;#[ORM\Column(length: 255, nullable: true)]private ?string $licenseKey = null;#[ORM\Column(nullable: true)]private ?bool $isRevoked = null;#[ORM\Column(nullable: true)]private ?bool $isRegistered = null;#[ORM\Column(length: 255, nullable: true)]private ?string $licenseHolderCrmId = null;#[ORM\Column(type: Types::JSON, nullable: true)]private ?array $modules = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $addedDate = null;#[ORM\ManyToOne(inversedBy: 'orderLicense')]#[ORM\JoinColumn(nullable: false)]private ?Order $orderInstance = null;public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getLicenseId(): ?string{return $this->licenseId;}public function setLicenseId(?string $licenseId): static{$this->licenseId = $licenseId;return $this;}public function getOrderNumber(): ?string{return $this->orderNumber;}public function setOrderNumber(?string $orderNumber): static{$this->orderNumber = $orderNumber;return $this;}public function getLicenseKey(): ?string{return $this->licenseKey;}public function setLicenseKey(?string $licenseKey): static{$this->licenseKey = $licenseKey;return $this;}public function isRevoked(): ?bool{return $this->isRevoked;}public function setIsRevoked(?bool $isRevoked): static{$this->isRevoked = $isRevoked;return $this;}public function isRegistered(): ?bool{return $this->isRegistered;}public function setIsRegistered(?bool $isRegistered): static{$this->isRegistered = $isRegistered;return $this;}public function getLicenseHolderCrmId(): ?string{return $this->licenseHolderCrmId;}public function setLicenseHolderCrmId(?string $licenseHolderCrmId): static{$this->licenseHolderCrmId = $licenseHolderCrmId;return $this;}/*** @return string[]*/public function getModules(): array{if ($this->modules === null) {return [];}return self::normalizeModules($this->modules);}/*** @param string[]|null $modules*/public function setModules(?array $modules): static{$this->modules = $modules !== null ? self::normalizeModules($modules) : null;return $this;}public function getModulesLabel(): string{return implode(', ', $this->getModules());}private static function normalizeModules(array $modules): array{$normalized = [];foreach ($modules as $module) {if (!is_scalar($module)) {continue;}$moduleName = trim((string) $module);if ($moduleName === '' || in_array($moduleName, $normalized, true)) {continue;}$normalized[] = $moduleName;}return $normalized;}public function getAddedDate(): ?\DateTimeInterface{return $this->addedDate;}public function setAddedDate(\DateTimeInterface $addedDate): static{$this->addedDate = $addedDate;return $this;}public function getOrderInstance(): ?Order{return $this->orderInstance;}public function setOrderInstance(?Order $orderInstance): static{$this->orderInstance = $orderInstance;return $this;}}