Пример #1
0
 /**
  * Picks the role with given code.
  *
  * @param string $code
  *
  * @return array
  *
  * @throws NonExistentCodeInternalException
  */
 public function pick($code)
 {
     $role = $this->connectToStorageInternalWorker->findOne($code);
     if (!$role) {
         throw new NonExistentCodeInternalException($code);
     }
     return $role;
 }
Пример #2
0
 /**
  * Collects roles.
  *
  * @return array
  */
 public function collect()
 {
     return $this->connectToStorageInternalWorker->find();
 }