<?phpdeclare(strict_types=1);namespace Croisiland\CommonBundle\Entity\Company;use Crea\MediaBundle\Entity\MediaTagOwnerInterface;use Crea\ToolsBundle\Entity\LifecycleUserIdentifierTrait;use Croisiland\CommonBundle\Annotation\Company\BookletFormValidator;use Croisiland\CommonBundle\Entity\Ship\Ship;use Croisiland\CommonBundle\Entity\Traits\IsVisibleTrait;use Croisiland\CommonBundle\Entity\Traits\ListOrderTrait;use Croisiland\CommonBundle\Repository\Company\BookletRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\Common\Util\ClassUtils;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=BookletRepository::class) * * @BookletFormValidator(groups={"booklet_form_validator"}) */class Booklet implements MediaTagOwnerInterface{ // TODO propertiés // true when image is created from command // private bool $auto = false; use ListOrderTrait; use IsVisibleTrait; use LifecycleUserIdentifierTrait; /** * @ORM\Id * * @ORM\GeneratedValue * * @ORM\Column(type="integer") */ private ?int $id; /** * @ORM\Column(type="string", length=255) */ private ?string $name = null; /** * @ORM\Column(type="text", nullable=true) */ private ?string $description = null; /** * @ORM\Column(type="integer", nullable=true) */ private ?int $thumbnailPdfPageNumber = null; /** * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="booklets") * * @ORM\JoinColumn(nullable=false) */ private ?Company $company = null; /** * @var Collection<int, Ship> * * @ORM\ManyToMany(targetEntity=Ship::class, inversedBy="booklets") */ private Collection $ships; public function __construct() { $this->ships = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getThumbnailPdfPageNumber(): ?int { return $this->thumbnailPdfPageNumber; } public function setThumbnailPdfPageNumber(?int $thumbnailPdfPageNumber): self { $this->thumbnailPdfPageNumber = $thumbnailPdfPageNumber; return $this; } public function getCompany(): ?Company { return $this->company; } public function setCompany(?Company $company): self { $this->company = $company; return $this; } /** * @return Collection<int, Ship> */ public function getShips(): Collection { return $this->ships; } public function addShip(Ship $ship): self { if (!$this->ships->contains($ship)) { $this->ships[] = $ship; } return $this; } public function removeShip(Ship $ship): self { $this->ships->removeElement($ship); return $this; } /** * Method liée au Média Bundle */ public function getMediaTagOwnerLabel(): ?string { return $this->getName(); } /** * Method liée au Média Bundle * @return class-string */ public function getFqcn(): string { return ClassUtils::getClass($this); }}