]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Application.php
Shorten air bundle route aliases
[airbundle] / Entity / Application.php
index 48e69929edb8fd4d2163638124f73b2cfc859bbe..4e94f204fe63f289d359f26d84187b9d033a1067 100644 (file)
@@ -61,6 +61,11 @@ class Application {
         * Constructor
         */
        public function __construct() {
         * 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;
        }
                $this->session = null;
                $this->user = null;
        }
@@ -79,9 +84,9 @@ class Application {
         *
         * @param Dance $dance
         *
         *
         * @param Dance $dance
         *
-        * @return Session
+        * @return Application
         */
         */
-       public function setDance(Dance $dance): Session {
+       public function setDance(Dance $dance): Application {
                $this->dance = $dance;
 
                return $this;
                $this->dance = $dance;
 
                return $this;
@@ -233,7 +238,7 @@ class Application {
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have an application instance
         */
        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'));
                }
                        //Set updated value
                        $application->setUpdated(new \DateTime('now'));
                }