Commit 2cef2811 authored by François Agneray's avatar François Agneray
Browse files

Merge branch '3.1' of gitlab.lam.fr:anis/anis-server into 3.1

parents d72d5ff3 3c6bfe8c
...@@ -32,7 +32,7 @@ class Attribute implements \JsonSerializable ...@@ -32,7 +32,7 @@ class Attribute implements \JsonSerializable
* @var App\Entity\Dataset * @var App\Entity\Dataset
* *
* @Id * @Id
* @ManyToOne(targetEntity="Dataset") * @ManyToOne(targetEntity="Dataset", inversedBy="attributes")
* @JoinColumn(name="dataset_name", referencedColumnName="name", nullable=false) * @JoinColumn(name="dataset_name", referencedColumnName="name", nullable=false)
*/ */
protected $dataset; protected $dataset;
......
...@@ -108,6 +108,13 @@ class Dataset implements \JsonSerializable ...@@ -108,6 +108,13 @@ class Dataset implements \JsonSerializable
*/ */
protected $datasetFamily; protected $datasetFamily;
/**
* @var Anis\Entity\Attribute[]
*
* @OneToMany(targetEntity="Attribute", mappedBy="dataset", cascade={"remove"})
*/
protected $attributes;
public function __construct($name) public function __construct($name)
{ {
$this->name = $name; $this->name = $name;
...@@ -229,6 +236,11 @@ class Dataset implements \JsonSerializable ...@@ -229,6 +236,11 @@ class Dataset implements \JsonSerializable
$this->datasetFamily = $datasetFamily; $this->datasetFamily = $datasetFamily;
} }
public function getAttributes()
{
return $this->attributes;
}
public function jsonSerialize() public function jsonSerialize()
{ {
return [ return [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment