* @ORM\OneToMany( * targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option", * mappedBy="parent") */ private Collection $children; /** * @var int * * @ORM\Id * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * @ORM\Column(type="string", length=50, name="internal_key") */ private $internalKey = ''; /** * @var string * @ORM\Column(type="string", length=15) */ private $key; /** * @var Option * @ORM\ManyToOne( * targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option", * inversedBy="children") * @ORM\JoinColumn(nullable=true) */ private $parent; /** * A json representation of text (multilingual). * * @var array * @ORM\Column(type="json") */ private $text; /** * @return bool */ public function getActive() { return $this->isActive(); } /** * @return Collection */ public function getChildren() { return $this->children; } /** * @return int */ public function getId() { return $this->id; } /** * @return string */ public function getInternalKey() { return $this->internalKey; } /** * @return string */ public function getKey() { return $this->key; } /** * @return Option */ public function getParent() { return $this->parent; } /** * @return array */ public function getText() { return $this->text; } /** * @return bool */ public function hasParent() { return null === $this->parent ? false : true; } /** * @return bool */ public function isActive() { return $this->active; } /** * @param $active * * @return $this */ public function setActive($active) { $this->active = $active; return $this; } /** * @param $internal_key * * @return $this */ public function setInternalKey($internal_key) { $this->internalKey = $internal_key; return $this; } /** * @param $key * * @return $this */ public function setKey($key) { $this->key = $key; return $this; } /** * @return $this */ public function setParent(?Option $parent = null) { $this->parent = $parent; $this->key = $parent->getKey(); return $this; } /** * @return $this */ public function setText(array $text) { $this->text = $text; return $this; } }