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.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/Model/CardMeta.php b/src/Model/CardMeta.php
new file mode 100644
index 0000000..2ec0da9
--- /dev/null
+++ b/src/Model/CardMeta.php
@@ -0,0 +1,57 @@
+<?php
+
+namespace Elements\Model;
+
+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\ManyToOne;
+
+#[Entity]
+#[Table(name: 'card_meta')]
+/**
+ * @Entity
+ * @Table(name="card_meta")
+ */
+class CardMeta
+{
+ #[Id]
+ #[Column(type: 'integer')]
+ #[GeneratedValue]
+ /**
+ * @Id
+ * @Column(type="integer")
+ * @GeneratedValue
+ */
+ public int $id;
+
+ #[Column(type: 'string')]
+ /**
+ * @Column(type="string")
+ */
+ public string $key;
+
+ #[Column(type: 'string')]
+ /**
+ * @Column(type="string")
+ */
+ public string $value;
+
+ #[ManyToOne(targetEntity: Card::class, inversedBy: 'meta')]
+ /**
+ * @ManyToOne(targetEntity="Card", inversedBy="meta", cascade={"persist"})
+ */
+ public Card $card;
+
+ /**
+ * CardMeta constructor.
+ */
+ public function __construct(string $key, string $value)
+ {
+ $this->key = $key;
+ $this->value = $value;
+ }
+}
+