예제 #1
0
 /**
  * Get all the room rights for a client
  *
  * @param      Client  $client  The client to grant the room rights
  *
  * @return     bool    True if the room right was added / updated, false otherwise
  */
 public function grantAllRoomRights(Client $client)
 {
     $roomRight = $client->getUser()->getRoomRight()->getEntityById($this->room->id);
     // Create the room right if it does not exist and add it to the user room right collection
     if ($roomRight === null) {
         $roomRight = new RoomRight();
         $roomRight->idRoom = $this->room->id;
         $roomRight->idUser = $client->getUser()->id;
         $client->getUser()->getRoomRight()->add($roomRight);
     }
     $roomRightEntityManager = new RoomRightEntityManager($roomRight);
     return $roomRightEntityManager->grantAll();
 }