]> Raphaël G. Git Repositories - airbundle/commitdiff
Remove short title
authorRaphaël Gertz <git@rapsys.eu>
Sat, 28 Aug 2021 04:53:44 +0000 (06:53 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Sat, 28 Aug 2021 04:53:44 +0000 (06:53 +0200)
Add preUpdate doctrine lifecycle callbacks

Entity/Location.php
Repository/LocationRepository.php
Resources/config/doctrine/Location.orm.yml

index 6e66cea61a45df62a33d9731308a0a984fb0e492..4af12808f9cf23e92cd57565941383fe03ee3048 100644 (file)
@@ -28,11 +28,6 @@ class Location {
         */
        private $title;
 
-       /**
-        * @var string
-        */
-       private $short;
-
        /**
         * @var string
         */
@@ -128,28 +123,6 @@ class Location {
                return $this->title;
        }
 
-       /**
-        * Set short
-        *
-        * @param string $short
-        *
-        * @return Location
-        */
-       public function setShort(string $short): Location {
-               $this->short = $short;
-
-               return $this;
-       }
-
-       /**
-        * Get short
-        *
-        * @return string
-        */
-       public function getShort(): string {
-               return $this->short;
-       }
-
        /**
         * Set address
         *
index f5efbc6cdc4c0b57194827b3edbb1c468a057e11..129a1763ee497dafc6b64bc339fbe20ab878fcc0 100644 (file)
@@ -148,7 +148,7 @@ ORDER BY '.(!empty($userId)?'COUNT(a.id) DESC, ':'').'COUNT(s.id) DESC, l.id'
                ];
 
                //Set the request
-               $req = 'SELECT l.id, l.title, l.short
+               $req = 'SELECT l.id, l.title
 FROM RapsysAirBundle:UserLocation AS ul
 JOIN RapsysAirBundle:Location AS l ON (l.id = ul.location_id)
 WHERE ul.user_id = :uid';
@@ -164,7 +164,6 @@ WHERE ul.user_id = :uid';
                $rsm->addEntityResult('RapsysAirBundle:Location', 'l');
                $rsm->addFieldResult('l', 'id', 'id');
                $rsm->addFieldResult('l', 'title', 'title');
-               $rsm->addFieldResult('l', 'short', 'short');
 
                //Send result
                return $em
index 41a3e0c7326ace6f77dfd23a4e322c0f1029a943..0cb8dfca3870c3763015fa925a71f9223e4d472c 100644 (file)
@@ -13,9 +13,6 @@ Rapsys\AirBundle\Entity\Location:
         title:
             type: string
             length: 32
-        short:
-            type: string
-            length: 16
         address:
             type: string
             length: 32
@@ -54,3 +51,5 @@ Rapsys\AirBundle\Entity\Location:
         #XXX: used in SessionRepository::(findAllPendingDailyWeather|findAllPendingHourlyWeather)
         zipcode:
             columns: [ zipcode ]
+    lifecycleCallbacks:
+        preUpdate: ['preUpdate']