original_string: public function authenticate($request = [])
      {
          if ($request) {
              $this->email = clean($request['email']);
              $this->password = $this->getPasswordHelper()->hash(clean($request['password']));
          } else {
              $this->password = $this->getPasswordHelper()->hash(clean($this->password));
          }
  
          $query = $this->getManager()->newQuery();
  
          $query->where("email = ?", $this->email);
          $query->where("password = ?", $this->password);
  
          /** @var User $user */
          $user = $this->getManager()->findOneByQuery($query);
  
          if ($user) {
              $this->writeData($user->toArray());
              $this->doAuthentication();
          }
  
          return $this->authenticated();
      }
code: public function authenticate($request = [])
      {
          if ($request) {
              $this->email = clean($request['email']);
              $this->password = $this->getPasswordHelper()->hash(clean($request['password']));
          } else {
              $this->password = $this->getPasswordHelper()->hash(clean($this->password));
          }
  
          $query = $this->getManager()->newQuery();
  
          $query->where("email = ?", $this->email);
          $query->where("password = ?", $this->password);
  
          /** @var User $user */
          $user = $this->getManager()->findOneByQuery($query);
  
          if ($user) {
              $this->writeData($user->toArray());
              $this->doAuthentication();
          }
  
          return $this->authenticated();
      }
code_tokens: public function authenticate ( $ request = [ ] ) { if ( $ request ) { $ this -> email = clean ( $ request [ 'email' ] ) ; $ this -> password = $ this -> getPasswordHelper ( ) -> hash ( clean ( $ request [ 'password' ] ) ) ; } else { $ this -> password = $ this -> getPasswordHelper ( ) -> hash ( clean ( $ this -> password ) ) ; } $ query = $ this -> getManager ( ) -> newQuery ( ) ; $ query -> where ( "email = ?" , $ this -> email ) ; $ query -> where ( "password = ?" , $ this -> password ) ; /** @var User $user */ $ user = $ this -> getManager ( ) -> findOneByQuery ( $ query ) ; if ( $ user ) { $ this -> writeData ( $ user -> toArray ( ) ) ; $ this -> doAuthentication ( ) ; } return $ this -> authenticated ( ) ; }
docstring: Authenticate user from request
  
  @param array $request
  @return bool|null
docstring_tokens: Authenticate user from request