diff options
Diffstat (limited to 'src/model/entities/NodeDataAsset.php')
| -rw-r--r-- | src/model/entities/NodeDataAsset.php | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/model/entities/NodeDataAsset.php b/src/model/entities/NodeDataAsset.php deleted file mode 100644 index d5eb141..0000000 --- a/src/model/entities/NodeDataAsset.php +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | <?php | ||
| 2 | // src/model/entities/NodeDataAsset.php | ||
| 3 | // | ||
| 4 | // entité intermédiaire 3 colonnes conçue selon le principe "slot <=> ressource unique" (paires node_data/role uniques) | ||
| 5 | // doctrine gère mal les clés primaires triples, j'ai donc choisi une clé primaire double node_data_id/role | ||
| 6 | |||
| 7 | declare(strict_types=1); | ||
| 8 | |||
| 9 | namespace App\Entity; | ||
| 10 | |||
| 11 | use Doctrine\ORM\Mapping as ORM; | ||
| 12 | |||
| 13 | #[ORM\Entity] | ||
| 14 | #[ORM\Table(name: TABLE_PREFIX . 'nodedata_asset')] | ||
| 15 | class NodeDataAsset | ||
| 16 | { | ||
| 17 | // clé primaire double | ||
| 18 | #[ORM\Id] | ||
| 19 | #[ORM\ManyToOne(targetEntity: NodeData::class, inversedBy: 'nda_collection')] | ||
| 20 | #[ORM\JoinColumn(name: 'node_data_id', referencedColumnName: 'id_node_data', onDelete: 'CASCADE')] | ||
| 21 | private NodeData $node_data; | ||
| 22 | |||
| 23 | #[ORM\Id] | ||
| 24 | #[ORM\Column(type: 'string', length: 50)] | ||
| 25 | private string $role; | ||
| 26 | |||
| 27 | #[ORM\ManyToOne(targetEntity: Asset::class)] | ||
| 28 | #[ORM\JoinColumn(name: 'asset_id', referencedColumnName: 'id_asset', onDelete: 'CASCADE')] | ||
| 29 | private Asset $asset; | ||
| 30 | |||
| 31 | public function __construct(NodeData $node_data, Asset $asset, string $role){ | ||
| 32 | $this->node_data = $node_data; | ||
| 33 | $this->asset = $asset; | ||
| 34 | $this->role = $role; | ||
| 35 | } | ||
| 36 | |||
| 37 | /*public function getNodeData(): NodeData | ||
| 38 | { | ||
| 39 | return $this->node_data; | ||
| 40 | }*/ | ||
| 41 | public function getAsset(): Asset | ||
| 42 | { | ||
| 43 | return $this->asset; | ||
| 44 | } | ||
| 45 | public function setAsset(Asset $asset): self | ||
| 46 | { | ||
| 47 | $this->asset = $asset; | ||
| 48 | return $this; | ||
| 49 | } | ||
| 50 | public function getRole(): string | ||
| 51 | { | ||
| 52 | return $this->role; | ||
| 53 | } | ||
| 54 | } | ||
