1 <?php
declare(strict_types
=1);
4 * This file is part of the Rapsys AirBundle 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
;
23 private ?int $id = null;
33 private ?float $score = null;
38 private ?\DateTime
$canceled = null;
43 private \DateTime
$created;
48 private \DateTime
$updated;
53 private $session = null;
63 public function __construct() {
65 $this->created
= new \
DateTime('now');
66 $this->updated
= new \
DateTime('now');
74 public function getId(): ?int {
85 public function setDance(Dance
$dance): Application
{
86 $this->dance
= $dance;
96 public function getDance(): Dance
{
103 * @param float $score
105 * @return Application
107 public function setScore(?float $score): Application
{
108 $this->score
= $score;
118 public function getScore(): ?float {
125 * @param \DateTime $canceled
127 * @return Application
129 public function setCanceled(?\DateTime
$canceled): Application
{
130 $this->canceled
= $canceled;
140 public function getCanceled(): ?\DateTime
{
141 return $this->canceled
;
147 * @param \DateTime $created
149 * @return Application
151 public function setCreated(\DateTime
$created): Application
{
152 $this->created
= $created;
162 public function getCreated(): \DateTime
{
163 return $this->created
;
169 * @param \DateTime $updated
171 * @return Application
173 public function setUpdated(\DateTime
$updated): Application
{
174 $this->updated
= $updated;
184 public function getUpdated(): \DateTime
{
185 return $this->updated
;
191 * @param Session $session
193 * @return Application
195 public function setSession(Session
$session): Application
{
196 $this->session
= $session;
206 public function getSession(): Session
{
207 return $this->session
;
215 * @return Application
217 public function setUser(User
$user): Application
{
228 public function getUser(): User
{
235 public function preUpdate(PreUpdateEventArgs
$eventArgs) {
236 //Check that we have an application instance
237 if (($application = $eventArgs->getObject()) instanceof Application
) {
239 $application->setUpdated(new \
DateTime('now'));