. */ namespace App\Entity\LabelSystem; use App\Entity\Attachments\AttachmentContainingDBElement; use App\Entity\Attachments\LabelAttachment; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity(repositoryClass="App\Repository\LabelProfileRepository") * @ORM\Table(name="label_profiles") * @ORM\EntityListeners({"App\EntityListeners\TreeCacheInvalidationListener"}) * @UniqueEntity({"name", "options.supported_element"}) */ class LabelProfile extends AttachmentContainingDBElement { /** * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\LabelAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"name" = "ASC"}) */ protected $attachments; /** * @var LabelOptions * @ORM\Embedded(class="LabelOptions") * @Assert\Valid() */ protected $options; /** * @var string The comment info for this element * @ORM\Column(type="text") */ protected $comment = ''; /** * @var bool Determines, if this label profile should be shown in the dropdown quick menu. * @ORM\Column(type="boolean") */ protected $show_in_dropdown = true; public function __construct() { parent::__construct(); $this->options = new LabelOptions(); } public function getOptions(): LabelOptions { return $this->options; } public function setOptions(LabelOptions $labelOptions): self { $this->options = $labelOptions; return $this; } /** * Get the comment of the element. * * @return string the comment */ public function getComment(): ?string { return $this->comment; } public function setComment(string $new_comment): string { $this->comment = $new_comment; return $this; } /** * Returns true, if this label profile should be shown in label generator quick menu. * * @return bool */ public function isShowInDropdown(): bool { return $this->show_in_dropdown; } /** * Sets the show in dropdown menu. * * @return LabelProfile */ public function setShowInDropdown(bool $show_in_dropdown): self { $this->show_in_dropdown = $show_in_dropdown; return $this; } }