summaryrefslogtreecommitdiff
path: root/src/Model/CardMeta.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model/CardMeta.php')
-rw-r--r--src/Model/CardMeta.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Model/CardMeta.php b/src/Model/CardMeta.php
index 2ec0da9..9e0f544 100644
--- a/src/Model/CardMeta.php
+++ b/src/Model/CardMeta.php
@@ -2,12 +2,15 @@
namespace Elements\Model;
+use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\Table;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
+use Doctrine\ORM\Mapping\ManyToMany;
use Doctrine\ORM\Mapping\ManyToOne;
+use Doctrine\ORM\PersistentCollection;
#[Entity]
#[Table(name: 'card_meta')]
@@ -45,6 +48,12 @@ class CardMeta
*/
public Card $card;
+ #[ManyToMany(targetEntity: Category::class, inversedBy: 'meta')]
+ /**
+ * @ManyToMany(targetEntity="Category", inversedBy="meta", cascade={"persist"})
+ */
+ public Collection|ArrayCollection|PersistentCollection $categories;
+
/**
* CardMeta constructor.
*/
@@ -52,6 +61,7 @@ class CardMeta
{
$this->key = $key;
$this->value = $value;
+ $this->categories = new ArrayCollection();
}
}