diff options
author | Daniel Weipert <code@drogueronin.de> | 2022-01-14 18:21:36 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2022-01-14 18:21:36 +0100 |
commit | 4cacc94240944ff316104bfd1b5e8e00fad14517 (patch) | |
tree | 2559dc3aa121d70bd645ff0a2fe56e1ae0695daa /src/Model/VoteArtwork.php | |
parent | 9c0893cb65df986b9edf0f48a6d4d2d65f27b8ef (diff) |
Add Artworks, Votes and better routing
Diffstat (limited to 'src/Model/VoteArtwork.php')
-rw-r--r-- | src/Model/VoteArtwork.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Model/VoteArtwork.php b/src/Model/VoteArtwork.php new file mode 100644 index 0000000..ee6ac8b --- /dev/null +++ b/src/Model/VoteArtwork.php @@ -0,0 +1,26 @@ +<?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: 'votes_artwork')] +/** + * @Entity + * @Table(name="votes_artwork") + */ +class VoteArtwork extends Vote +{ + #[ManyToOne(targetEntity: Artwork::class, inversedBy: 'votes')] + /** + * @ManyToOne(targetEntity="Artwork", inversedBy="votes", cascade={"persist"}) + */ + public Artwork $artwork; +} + |