Skip to content

Commit

Permalink
Merge pull request #43 from 2lenet/fixSymfonyInsightErrors
Browse files Browse the repository at this point in the history
Fix errors
  • Loading branch information
valentin-helies authored Sep 7, 2023
2 parents 5954e19 + 537e012 commit e1f6d97
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Repository/WidgetRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;
}
Expand All @@ -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')
Expand All @@ -57,23 +57,23 @@ 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()
;
}

/**
* @param $user_id
* @param $userId
* @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException
* Obtenir le widget le plus bas de la grille
*/
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")
Expand All @@ -89,7 +89,7 @@ public function deleteDefaultDashboard(): QueryBuilder
{
return $this->createQueryBuilder("w")
->delete()
->andWhere("w.user_id IS NULL");
->andWhere("w.userId IS NULL");
}

/**
Expand All @@ -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);
}

Expand All @@ -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");
}
}

0 comments on commit e1f6d97

Please sign in to comment.