1 <?php
declare(strict_types
=1);
4 * this file is part of the rapsys packbundle package.
6 * (c) raphaël gertz <symfony@rapsys.eu>
8 * for the full copyright and license information, please view the license
9 * file that was distributed with this source code.
12 namespace Rapsys\AirBundle\Entity
;
14 use Doctrine\ORM\Event\PreUpdateEventArgs
;
51 * @var \Rapsys\AirBundle\Entity\Session
56 * @var \Rapsys\AirBundle\Entity\User
63 public function __construct() {
66 $this->canceled
= null;
67 $this->created
= new \
DateTime('now');
68 $this->updated
= new \
DateTime('now');
69 $this->session
= null;
78 public function getId(): int {
89 public function setDance(Dance
$dance): Application
{
90 $this->dance
= $dance;
100 public function getDance(): Dance
{
107 * @param float $score
109 * @return Application
111 public function setScore(?float $score): Application
{
112 $this->score
= $score;
122 public function getScore(): ?float {
129 * @param \DateTime $canceled
131 * @return Application
133 public function setCanceled(?\DateTime
$canceled): Application
{
134 $this->canceled
= $canceled;
144 public function getCanceled(): ?\DateTime
{
145 return $this->canceled
;
151 * @param \DateTime $created
153 * @return Application
155 public function setCreated(\DateTime
$created): Application
{
156 $this->created
= $created;
166 public function getCreated(): \DateTime
{
167 return $this->created
;
173 * @param \DateTime $updated
175 * @return Application
177 public function setUpdated(\DateTime
$updated): Application
{
178 $this->updated
= $updated;
188 public function getUpdated(): \DateTime
{
189 return $this->updated
;
195 * @param Session $session
197 * @return Application
199 public function setSession(Session
$session): Application
{
200 $this->session
= $session;
210 public function getSession(): Session
{
211 return $this->session
;
219 * @return Application
221 public function setUser(User
$user): Application
{
232 public function getUser(): User
{
239 public function preUpdate(PreUpdateEventArgs
$eventArgs) {
240 //Check that we have an application instance
241 if (($application = $eventArgs->getEntity()) instanceof Application
) {
243 $application->setUpdated(new \
DateTime('now'));