* (c) Chrystel Moreau * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace App\Entity\Metamodel; use Doctrine\Common\Collections\ArrayCollection; /** * @Entity * @Table(name="dataset") */ class Dataset implements \JsonSerializable { /** * @var string * * @Id * @Column(type="string", nullable=false) */ protected $name; /** * @var string * * @Column(type="string", name="table_ref", nullable=false) */ protected $tableRef; /** * @var string * * @Column(type="string", nullable=false) */ protected $label; /** * @var string * * @Column(type="text", nullable=true) */ protected $description; /** * @var integer * * @Column(type="integer", nullable=false) */ protected $display; /** * @var integer * * @Column(type="integer", nullable=true) */ protected $count; /** * @var bool * * @Column(type="boolean", nullable=true) */ protected $vo; /** * @var string * * @Column(type="string", name="data_path", nullable=true) */ protected $dataPath; /** * @var bool * * @Column(type="boolean", name="selectable_raw", nullable=false) */ protected $selectableRaw; /** * @var Anis\Entity\Project * * @ManyToOne(targetEntity="Project", inversedBy="datasets") * @JoinColumn(name="project_name", referencedColumnName="name", nullable=false) */ protected $project; /** * @var Anis\Entity\Project * * @ManyToOne(targetEntity="DatasetFamily", inversedBy="datasets") * @JoinColumn(name="id_dataset_family", referencedColumnName="id", nullable=true) */ protected $datasetFamily; /** * @var Anis\Entity\Attribute[] * * @OneToMany(targetEntity="Attribute", mappedBy="dataset", cascade={"remove"}) */ protected $attributes; /** * @var Anis\Entity\File[] * * @OneToMany(targetEntity="File", mappedBy="dataset", cascade={"remove"}) */ protected $files; /** * @var Anis\Entity\DatasetPrivileges * * @OneToMany(targetEntity="DatasetPrivileges", mappedBy="dataset") */ protected $datasetPrivileges; public function __construct($name) { $this->name = $name; $this->attributes = new ArrayCollection; } public function getName() { return $this->name; } public function getTableRef() { return $this->tableRef; } public function setTableRef($tableRef) { return $this->tableRef = $tableRef; } public function getLabel() { return $this->label; } public function setLabel($label) { $this->label = $label; } public function getDescription() { return $this->description; } public function setDescription($description) { $this->description = $description; } public function getDisplay() { return $this->display; } public function setDisplay($display) { $this->display = (int) $display; } public function getCount() { return $this->count; } public function setCount($count) { $this->count = (int) $count; } public function getVo() { return $this->vo; } public function setVo($vo) { $this->vo = (bool) $vo; } public function getDataPath() { return $this->dataPath; } public function setDataPath($dataPath) { $this->dataPath = $dataPath; } public function getSelectableRaw() { return $this->selectableRaw; } public function setSelectableRaw($selectableRaw) { $this->selectableRaw = $selectableRaw; } public function getProject() { return $this->project; } public function setProject(Project $project) { $this->project = $project; } public function getDatasetFamily() { return $this->datasetFamily; } public function setDatasetFamily($datasetFamily) { $this->datasetFamily = $datasetFamily; } public function getAttributes() { return $this->attributes; } public function getFiles() { return $this->files; } public function getJoins() { return $this->joins; } public function getDatasetPrivileges() { return $this->datasetPrivileges; } public function jsonSerialize() { return [ 'name' => $this->getName(), 'table_ref' => $this->getTableRef(), 'label' => $this->getLabel(), 'description' => $this->getDescription(), 'display' => $this->getDisplay(), 'count' => $this->getCount(), 'vo' => $this->getVo(), 'data_path' => $this->getDataPath(), 'selectable_raw' => $this->getSelectableRaw(), 'project_name' => $this->getProject()->getName(), 'id_dataset_family' => $this->getDatasetFamily()->getId() ]; } }