From 537e012f4e4f7a26c7a78d506e71f795417b0504 Mon Sep 17 00:00:00 2001 From: Valentin HELIES Date: Thu, 7 Sep 2023 15:44:31 +0200 Subject: [PATCH] Fix errors --- src/Repository/WidgetRepository.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Repository/WidgetRepository.php b/src/Repository/WidgetRepository.php index 4c24b00..c7eb968 100644 --- a/src/Repository/WidgetRepository.php +++ b/src/Repository/WidgetRepository.php @@ -32,7 +32,7 @@ public function getMyWidgets(UserInterface $user): QueryBuilder return $this->createQueryBuilder("w") ->select('w') - ->where('w.user_id = :user_id') + ->where('w.userId = :user_id') ->setParameter('user_id', $userId) ; } @@ -45,7 +45,7 @@ public function getWidgetsOrderedByY(UserInterface $user): array $userId = method_exists($user, 'getId') ? $user->getId() : null; return $this->createQueryBuilder('w') - ->where('w.user_id = :userId') + ->where('w.userId = :userId') ->setParameter('userId', $userId) ->addOrderBy('w.y', 'ASC') ->addOrderBy('w.x', 'ASC') @@ -57,7 +57,7 @@ public function deleteMyWidgets(int $userId): void { $this->createQueryBuilder("w") ->delete() - ->where("w.user_id = :user_id") + ->where("w.userId = :user_id") ->setParameter("user_id", $userId) ->getQuery() ->execute() @@ -65,7 +65,7 @@ public function deleteMyWidgets(int $userId): void } /** - * @param $user_id + * @param $userId * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException * Obtenir le widget le plus bas de la grille @@ -73,7 +73,7 @@ public function deleteMyWidgets(int $userId): void public function getBottomWidget(int $userId): ?Widget { return $this->createQueryBuilder("w") - ->where("w.user_id = :user_id") + ->where("w.userId = :user_id") ->setParameter("user_id", $userId) ->addOrderBy("w.y", "DESC") ->addOrderBy("w.height", "DESC") @@ -89,7 +89,7 @@ public function deleteDefaultDashboard(): QueryBuilder { return $this->createQueryBuilder("w") ->delete() - ->andWhere("w.user_id IS NULL"); + ->andWhere("w.userId IS NULL"); } /** @@ -101,8 +101,8 @@ public function setDashboardAsDefault(int $userId): QueryBuilder { return $this->createQueryBuilder("w") ->update() - ->set("w.user_id", "NULL") - ->andWhere("w.user_id = :userId") + ->set("w.userId", "NULL") + ->andWhere("w.userId = :userId") ->setParameter("userId", $userId); } @@ -113,6 +113,6 @@ public function deleteAllUserDashboards(): QueryBuilder { return $this->createQueryBuilder("w") ->delete() - ->andWhere("w.user_id IS NOT NULL"); + ->andWhere("w.userId IS NOT NULL"); } }