diff --git a/src/Entity/Choice.php b/src/Entity/Choice.php index cd838e4..8db1eba 100644 --- a/src/Entity/Choice.php +++ b/src/Entity/Choice.php @@ -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 { /** diff --git a/src/Entity/Poll.php b/src/Entity/Poll.php index 442f450..01521c8 100644 --- a/src/Entity/Poll.php +++ b/src/Entity/Poll.php @@ -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;