1 | <?php |
||
55 | class MemberNeed implements EntityInterface, GetMemberInterface |
||
56 | { |
||
57 | use Traits\PropertyIdGeneratedTrait; |
||
58 | |||
59 | /** |
||
60 | * @var \DateTimeImmutable |
||
61 | * @ORM\Column(name="date", type="date_immutable", nullable=false) |
||
62 | * |
||
63 | * @Assert\Date() |
||
64 | * |
||
65 | * @Serializer\Groups({"get", "put", "post"}) |
||
66 | * @@OA\ApiProperty( |
||
67 | * attributes={ |
||
68 | * "swagger_context"={"type"="string", "format"="date_immutable", "example"="2000-01-01"}, |
||
69 | * "normalization_context"={"date_format"="Y-m-d", "datetime_format"="Y-m-d"}, |
||
70 | * } |
||
71 | * ) |
||
72 | * @OA\ApiFilter( |
||
73 | * ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter::class, |
||
74 | * strategy="ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter::INCLUDE_NULL_BEFORE" |
||
75 | * ) |
||
76 | * @OA\ApiFilter( |
||
77 | * ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter::class, |
||
78 | * strategy="exact" |
||
79 | * ) |
||
80 | */ |
||
81 | private $date; |
||
82 | |||
83 | /** |
||
84 | * @var int |
||
85 | * @ORM\Column(name="places", type="integer", nullable=false) |
||
86 | * |
||
87 | * @Assert\PositiveOrZero() |
||
88 | * |
||
89 | * @Serializer\Groups({"get"}) |
||
90 | * @@OA\ApiProperty( |
||
91 | * attributes={ |
||
92 | * "swagger_context"={"type"="integer", "example"=0}, |
||
93 | * } |
||
94 | * ) |
||
95 | * @OA\ApiFilter( |
||
96 | * ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\RangeFilter::class |
||
97 | * ) |
||
98 | * @OA\ApiFilter( |
||
99 | * ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter::class, |
||
100 | * strategy="exact" |
||
101 | * ) |
||
102 | */ |
||
103 | private $places; |
||
104 | |||
105 | /** |
||
106 | * @var string |
||
107 | * @ORM\Column(name="reason", type="string", length=255, nullable=false) |
||
108 | * |
||
109 | * @Assert\NotBlank() |
||
110 | * @Assert\Length(min="1", max="255") |
||
111 | * |
||
112 | * @Serializer\Groups({"get", "put", "post"}) |
||
113 | * @OA\ApiFilter( |
||
114 | * ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter::class, |
||
115 | * strategy="partial" |
||
116 | * ) |
||
117 | */ |
||
118 | private $reason; |
||
119 | |||
120 | //------------------------------------------------------------------------------------------- |
||
121 | |||
122 | /** |
||
123 | * @var Member |
||
124 | * @ORM\ManyToOne(targetEntity="App\Entity\Parking\Member", inversedBy="memberNeeds") |
||
125 | * @ORM\JoinColumn(name="member_id", referencedColumnName="id") |
||
126 | * |
||
127 | * @Assert\NotNull() |
||
128 | * |
||
129 | * @Serializer\Groups({"get", "post"}) |
||
130 | * @OA\ApiProperty() |
||
131 | * @OA\ApiSubresource(maxDepth=1) |
||
132 | * @OA\ApiFilter( |
||
133 | * ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter::class, |
||
134 | * strategy="exact" |
||
135 | * ) |
||
136 | * @OA\ApiFilter( |
||
137 | * ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter::class, |
||
138 | * strategy="exact", |
||
139 | * properties={"member.id"} |
||
140 | * ) |
||
141 | */ |
||
142 | protected $member; |
||
143 | |||
144 | //------------------------------------------------------------------------------------------- |
||
145 | |||
146 | public function __construct( |
||
158 | |||
159 | //------------------------------------------------------------------------------------------- |
||
160 | |||
161 | public function getMember(): Member |
||
165 | |||
166 | public function getPlaces(): int |
||
170 | |||
171 | public function getReason(): string |
||
175 | |||
176 | public function setReason(string $reason): self |
||
182 | |||
183 | public function getDate(): \DateTimeImmutable |
||
187 | |||
188 | public function setDate(\DateTimeImmutable $date): self |
||
194 | } |
||
195 |