]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Snippet.php
Reorder constructor arguments
[airbundle] / Entity / Snippet.php
index 4e9d406c2b10572a3e48a29c6e59a0cc1d6a4c5f..a764a6602586c3c121476d77a266f7d41bbc3f8a 100644 (file)
@@ -96,6 +96,7 @@ class Snippet {
         * Constructor
         */
        public function __construct() {
+               //Set defaults
                $this->description = null;
                $this->class = null;
                $this->short = null;
@@ -105,6 +106,9 @@ class Snippet {
                $this->donate = null;
                $this->link = null;
                $this->profile = null;
+               $this->location = null;
+               $this->created = new \DateTime('now');
+               $this->updated = new \DateTime('now');
        }
 
        /**
@@ -426,7 +430,7 @@ class Snippet {
        /**
         * {@inheritdoc}
         */
-       public function preUpdate(\Doctrine\ORM\Event\PreUpdateEventArgs  $eventArgs) {
+       public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have an snippet instance
                if (($snippet = $eventArgs->getEntity()) instanceof Snippet) {
                        //Set updated value