From: Raphaƫl Gertz Date: Sat, 28 Aug 2021 04:53:44 +0000 (+0200) Subject: Remove short title X-Git-Tag: 0.2.0~54 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/62564be28991a32bf3b72f334bd165da5bdb088d Remove short title Add preUpdate doctrine lifecycle callbacks --- diff --git a/Entity/Location.php b/Entity/Location.php index 6e66cea..4af1280 100644 --- a/Entity/Location.php +++ b/Entity/Location.php @@ -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 * diff --git a/Repository/LocationRepository.php b/Repository/LocationRepository.php index f5efbc6..129a176 100644 --- a/Repository/LocationRepository.php +++ b/Repository/LocationRepository.php @@ -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 diff --git a/Resources/config/doctrine/Location.orm.yml b/Resources/config/doctrine/Location.orm.yml index 41a3e0c..0cb8dfc 100644 --- a/Resources/config/doctrine/Location.orm.yml +++ b/Resources/config/doctrine/Location.orm.yml @@ -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']