Exemplo n.º 1
0
 /**
  * Gets the proper UsersRepository find method for a user
  * based on the fieldname being passed in.
  *
  * @param  string  $fieldname
  * @param  string  $value
  * @return DvsUser
  */
 protected function retrieveUserFindMethodByField($fieldname, $value)
 {
     switch ($fieldname) {
         case "username":
             return $this->UsersRepository->findByUsername($value);
         case "email":
             return $this->UsersRepository->findByEmail($value);
     }
 }
Exemplo n.º 2
0
 /**
  * Convenience function to get current user's id
  *
  * @return integer
  */
 public function currentUserId()
 {
     return $this->UsersRepository->retrieveCurrentUserId();
 }