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 * one poll choice, could be a text or a date
* @ORM\Entity(repositoryClass="App\Repository\ChoiceRepository") * @ORM\Entity(repositoryClass="App\Repository\ChoiceRepository")
* @Serializer\ExclusionPolicy("all")
*/ */
class Choice { class Choice {
/** /**

View File

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