From d750c6b8ba0a2bc2767677f1b7319849ab8b2521 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 12 Oct 2021 07:53:17 +0000 Subject: [PATCH] Add sorting to Vehicle's getBatteries. #628 --- src/Entity/Vehicle.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Entity/Vehicle.php b/src/Entity/Vehicle.php index 99ec7779..a93bed4e 100644 --- a/src/Entity/Vehicle.php +++ b/src/Entity/Vehicle.php @@ -56,6 +56,7 @@ class Vehicle // link to batteries compatible with this vehicle /** * @ORM\ManyToMany(targetEntity="Battery", mappedBy="vehicles", indexBy="id", fetch="EXTRA_LAZY") + * @ORM\OrderBy({"sell_price" = "DESC"}) */ protected $batteries;