diff options
author | Daniel Weipert <code@drogueronin.de> | 2022-01-10 20:29:04 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2022-01-10 20:29:04 +0100 |
commit | a319f3a419790925bed539ba141038c72a83e70f (patch) | |
tree | dfb24183cc693863df733e190dbbc6da93bb82e5 /src/Model/CardMeta.php |
Initial commit
Diffstat (limited to 'src/Model/CardMeta.php')
-rw-r--r-- | src/Model/CardMeta.php | 57 |
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; + } +} + |