mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
sf4 deprecated: migrate Doctrine ORM mapping to annotation
This commit is contained in:
@@ -19,93 +19,134 @@
|
||||
|
||||
namespace Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ORM\Entity(
|
||||
* repositoryClass="Chill\CustomFieldsBundle\EntityRepository\CustomFieldLongChoice\OptionRepository")
|
||||
* @ORM\Table(name="custom_field_long_choice_options")
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class Option
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @var int
|
||||
* @ORM\Id
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
* @ORM\Column(type="string", length=15)
|
||||
*/
|
||||
private $key;
|
||||
|
||||
/**
|
||||
* a json representation of text (multilingual)
|
||||
* A json representation of text (multilingual)
|
||||
*
|
||||
* @var array
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
private $text;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \Doctrine\Common\Collections\Collection
|
||||
* @var Collection
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option",
|
||||
* mappedBy="parent")
|
||||
*/
|
||||
private $children;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Option
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option",
|
||||
* inversedBy="children")
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
private $parent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
* @ORM\Column(type="string", length=50, name="internal_key")
|
||||
*/
|
||||
private $internalKey = '';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
private $active = true;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getText()
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getChildren()
|
||||
{
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Option
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $key
|
||||
* @return $this
|
||||
*/
|
||||
public function setKey($key)
|
||||
{
|
||||
$this->key = $key;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $text
|
||||
* @return $this
|
||||
*/
|
||||
public function setText(array $text)
|
||||
{
|
||||
$this->text = $text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Option|null $parent
|
||||
* @return $this
|
||||
*/
|
||||
public function setParent(Option $parent = null)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
@@ -122,32 +163,48 @@ class Option
|
||||
return $this->parent === NULL ? false : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getInternalKey()
|
||||
{
|
||||
return $this->internalKey;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isActive()
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function getActive()
|
||||
{
|
||||
return $this->isActive();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $internal_key
|
||||
* @return $this
|
||||
*/
|
||||
public function setInternalKey($internal_key)
|
||||
{
|
||||
$this->internalKey = $internal_key;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $active
|
||||
* @return $this
|
||||
*/
|
||||
public function setActive($active)
|
||||
{
|
||||
$this->active = $active;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user