X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/f0ed7af138b95f31354f8d5a37cb4cd27b902a75..8af69ac700a76d252d0c2beceaeee29b41f5d483:/Entity/Application.php?ds=sidebyside diff --git a/Entity/Application.php b/Entity/Application.php index 5d31203..b2672a1 100644 --- a/Entity/Application.php +++ b/Entity/Application.php @@ -1,11 +1,11 @@ + * (c) Raphaël Gertz * - * for the full copyright and license information, please view the license + * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ @@ -18,56 +18,52 @@ use Doctrine\ORM\Event\PreUpdateEventArgs; */ class Application { /** - * @var integer + * Primary key */ - private $id; + private ?int $id = null; /** - * @var Dance + * Dance instance */ - private $dance; + private Dance $dance; /** - * @var float + * Score */ - private $score; + private ?float $score = null; /** - * @var \DateTime + * Cancel datetime */ - private $canceled; + private ?\DateTime $canceled = null; /** - * @var \DateTime + * Create datetime */ - private $created; + private \DateTime $created; /** - * @var \DateTime + * Update datetime */ - private $updated; + private \DateTime $updated; /** - * @var \Rapsys\AirBundle\Entity\Session + * Session instance */ - private $session; + private $session = null; /** - * @var \Rapsys\AirBundle\Entity\User + * User instance */ - private $user; + private $user = null; /** * Constructor */ public function __construct() { //Set defaults - $this->score = null; - $this->canceled = null; $this->created = new \DateTime('now'); $this->updated = new \DateTime('now'); - $this->session = null; - $this->user = null; } /** @@ -75,7 +71,7 @@ class Application { * * @return integer */ - public function getId(): int { + public function getId(): ?int { return $this->id; } @@ -238,7 +234,7 @@ class Application { */ public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have an application instance - if (($application = $eventArgs->getEntity()) instanceof Application) { + if (($application = $eventArgs->getObject()) instanceof Application) { //Set updated value $application->setUpdated(new \DateTime('now')); }