@@ -7,21 +7,21 @@ |
||
| 7 | 7 | |
| 8 | 8 | class AccountRepository extends EntityRepository |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * function that return a list of all users that are not archived and different of current account |
|
| 12 | - * @param User $current_account |
|
| 13 | - * @param bool $archived |
|
| 14 | - * @return array |
|
| 15 | - */ |
|
| 16 | - public function findAllUserArchived(User $current_account, bool $archived = false): array |
|
| 17 | - { |
|
| 18 | - $query = $this->getEntityManager()->createQuery("SELECT fu FROM RibsAdminBundle:Account fu |
|
| 10 | + /** |
|
| 11 | + * function that return a list of all users that are not archived and different of current account |
|
| 12 | + * @param User $current_account |
|
| 13 | + * @param bool $archived |
|
| 14 | + * @return array |
|
| 15 | + */ |
|
| 16 | + public function findAllUserArchived(User $current_account, bool $archived = false): array |
|
| 17 | + { |
|
| 18 | + $query = $this->getEntityManager()->createQuery("SELECT fu FROM RibsAdminBundle:Account fu |
|
| 19 | 19 | JOIN RibsAdminBundle:User u WITH fu.user = u |
| 20 | 20 | WHERE u.archived = :archived and u != :current_account |
| 21 | 21 | ") |
| 22 | - ->setParameter("archived", $archived) |
|
| 23 | - ->setParameter("current_account", $current_account); |
|
| 22 | + ->setParameter("archived", $archived) |
|
| 23 | + ->setParameter("current_account", $current_account); |
|
| 24 | 24 | |
| 25 | - return $query->getResult(); |
|
| 26 | - } |
|
| 25 | + return $query->getResult(); |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -7,38 +7,38 @@ |
||
| 7 | 7 | |
| 8 | 8 | class NavigationRepository extends EntityRepository |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * function that return all navigation links of pages and modules |
|
| 12 | - * @return array |
|
| 13 | - * @throws DBALException |
|
| 14 | - */ |
|
| 15 | - public function findAllNavigation(): array |
|
| 16 | - { |
|
| 17 | - $query = $this->getEntityManager()->getConnection()->prepare("SELECT p.url, p.title, p.title_tag FROM navigation n |
|
| 10 | + /** |
|
| 11 | + * function that return all navigation links of pages and modules |
|
| 12 | + * @return array |
|
| 13 | + * @throws DBALException |
|
| 14 | + */ |
|
| 15 | + public function findAllNavigation(): array |
|
| 16 | + { |
|
| 17 | + $query = $this->getEntityManager()->getConnection()->prepare("SELECT p.url, p.title, p.title_tag FROM navigation n |
|
| 18 | 18 | LEFT JOIN page p ON n.id_page = p.id AND p.displayed = 1 |
| 19 | 19 | LEFT JOIN module m ON n.id_module = m.id AND m.displayed = 1 |
| 20 | 20 | ORDER BY n.order ASC |
| 21 | 21 | "); |
| 22 | 22 | |
| 23 | - $query->execute(); |
|
| 23 | + $query->execute(); |
|
| 24 | 24 | |
| 25 | - return $query->fetchAll(\PDO::FETCH_ASSOC); |
|
| 26 | - } |
|
| 25 | + return $query->fetchAll(\PDO::FETCH_ASSOC); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * function that return all navigation links of pages |
|
| 30 | - * @return array |
|
| 31 | - * @throws DBALException |
|
| 32 | - */ |
|
| 33 | - public function findAllNavigationPage(): array |
|
| 34 | - { |
|
| 35 | - $query = $this->getEntityManager()->getConnection()->prepare("SELECT p.url, p.title, p.title_tag FROM navigation n |
|
| 28 | + /** |
|
| 29 | + * function that return all navigation links of pages |
|
| 30 | + * @return array |
|
| 31 | + * @throws DBALException |
|
| 32 | + */ |
|
| 33 | + public function findAllNavigationPage(): array |
|
| 34 | + { |
|
| 35 | + $query = $this->getEntityManager()->getConnection()->prepare("SELECT p.url, p.title, p.title_tag FROM navigation n |
|
| 36 | 36 | INNER JOIN page p ON n.id_page = p.id AND p.displayed = 1 |
| 37 | 37 | ORDER BY n.order ASC |
| 38 | 38 | "); |
| 39 | 39 | |
| 40 | - $query->execute(); |
|
| 40 | + $query->execute(); |
|
| 41 | 41 | |
| 42 | - return $query->fetchAll(\PDO::FETCH_ASSOC); |
|
| 43 | - } |
|
| 42 | + return $query->fetchAll(\PDO::FETCH_ASSOC); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -8,33 +8,33 @@ |
||
| 8 | 8 | |
| 9 | 9 | class AccessRightRepository extends EntityRepository |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * function that delete all user which are in a list of rights |
|
| 13 | - * @param AccessRight $access_right |
|
| 14 | - * @throws DBALException |
|
| 15 | - */ |
|
| 16 | - public function deleteAllUsersList(AccessRight $access_right) |
|
| 17 | - { |
|
| 18 | - $query = $this->getEntityManager()->getConnection()->prepare("UPDATE user SET id_access_right = NULL WHERE |
|
| 11 | + /** |
|
| 12 | + * function that delete all user which are in a list of rights |
|
| 13 | + * @param AccessRight $access_right |
|
| 14 | + * @throws DBALException |
|
| 15 | + */ |
|
| 16 | + public function deleteAllUsersList(AccessRight $access_right) |
|
| 17 | + { |
|
| 18 | + $query = $this->getEntityManager()->getConnection()->prepare("UPDATE user SET id_access_right = NULL WHERE |
|
| 19 | 19 | id_access_right = :id_access_right |
| 20 | 20 | "); |
| 21 | - $query->bindValue("id_access_right", $access_right->getId()); |
|
| 22 | - $query->execute(); |
|
| 23 | - } |
|
| 21 | + $query->bindValue("id_access_right", $access_right->getId()); |
|
| 22 | + $query->execute(); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * function that add a user in an access right list |
|
| 27 | - * @param int $access_right_id |
|
| 28 | - * @param string $guid_admin |
|
| 29 | - * @throws DBALException |
|
| 30 | - */ |
|
| 31 | - public function setAccessRightListUser(int $access_right_id, string $guid_admin) |
|
| 32 | - { |
|
| 33 | - $query = $this->getEntityManager()->getConnection()->prepare("UPDATE user SET id_access_right = :id_access_right WHERE |
|
| 25 | + /** |
|
| 26 | + * function that add a user in an access right list |
|
| 27 | + * @param int $access_right_id |
|
| 28 | + * @param string $guid_admin |
|
| 29 | + * @throws DBALException |
|
| 30 | + */ |
|
| 31 | + public function setAccessRightListUser(int $access_right_id, string $guid_admin) |
|
| 32 | + { |
|
| 33 | + $query = $this->getEntityManager()->getConnection()->prepare("UPDATE user SET id_access_right = :id_access_right WHERE |
|
| 34 | 34 | guid = :guid_user |
| 35 | 35 | "); |
| 36 | - $query->bindValue("id_access_right", $access_right_id, \PDO::PARAM_INT); |
|
| 37 | - $query->bindValue("guid_user", $guid_admin, \PDO::PARAM_STR); |
|
| 38 | - $query->execute(); |
|
| 39 | - } |
|
| 36 | + $query->bindValue("id_access_right", $access_right_id, \PDO::PARAM_INT); |
|
| 37 | + $query->bindValue("guid_user", $guid_admin, \PDO::PARAM_STR); |
|
| 38 | + $query->execute(); |
|
| 39 | + } |
|
| 40 | 40 | } |