1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00

add expose annotations

This commit is contained in:
Baptiste Lemoine 2019-12-01 15:20:07 +01:00
parent 5318a8bd99
commit ee93cd5c26
2 changed files with 11 additions and 1 deletions

View File

@ -10,6 +10,7 @@ use JMS\Serializer\Annotation as Serializer;
/**
* one poll choice, could be a text or a date
* @ORM\Entity(repositoryClass="App\Repository\ChoiceRepository")
* @Serializer\ExclusionPolicy("all")
*/
class Choice {
/**

View File

@ -10,7 +10,7 @@ use JMS\Serializer\Annotation as Serializer;
/**
* @ORM\Entity(repositoryClass="App\Repository\PollRepository")
* @Serializer\ExclusionPolicy("ALL")
* @Serializer\ExclusionPolicy("all")
*/
class Poll {
/**
@ -86,44 +86,52 @@ class Poll {
* send a mail on a new comment
* @ORM\Column(type="boolean", nullable=true)
* @Serializer\Type("boolean")
* @Serializer\Expose()
*/
public $mailOnComment;
/**
* send a mail on a new vote
* @ORM\Column(type="boolean", nullable=true)
* @Serializer\Type("boolean")
* @Serializer\Expose()
*/
public $mailOnVote;
/**
* hide publicly results
* @ORM\Column(type="boolean", nullable=true)
* @Serializer\Type("boolean")
* @Serializer\Expose()
*/
public $hideResults;
/**
* show publicly results even if there is a password to access the vote
* @ORM\Column(type="boolean", nullable=true)
* @Serializer\Type("boolean")
* @Serializer\Expose()
*/
public $showResultEvenIfPasswords;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Vote", mappedBy="poll", orphanRemoval=true, cascade={"persist", "remove"})
* @Serializer\Type("App\Entity\Vote")
* @Serializer\Expose()
*/
public $votes;
/**
* @ORM\OneToMany(targetEntity="App\Entity\StackOfVotes", mappedBy="poll", orphanRemoval=true, cascade={"persist", "remove"})
* @Serializer\Type("App\Entity\StackOfVotes")
* @Serializer\Expose()
*/
public $stacksOfVotes;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Choice", mappedBy="poll", orphanRemoval=true, cascade={"persist", "remove"})
* @Serializer\Type("App\Entity\Choice")
* @Serializer\Expose()
*/
public $choices;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Comment", mappedBy="poll", orphanRemoval=true, cascade={"persist", "remove"})
* @Serializer\Type("App\Entity\Comment")
* @Serializer\Expose()
*/
public $comments;
/**
@ -141,6 +149,7 @@ class Poll {
/**
* number of days from now for default expiracy date
* @var int
* @Serializer\Expose()
*/
public $defaultExpiracyDaysFromNow = 60;
private $maxChoicesLimit = 25;