Dibi\Connection::select PHP Méthode

select() public méthode

public select ( $args ) : dibi\Fluent
Résultat dibi\Fluent
    public function select($args)
    {
        $args = func_get_args();
        return $this->command()->__call('select', $args);
    }

Usage Example

Exemple #1
0
 /**
  * Performs an authentication.
  * @param array $credentials
  * @return Identity
  * @throws AuthenticationException
  */
 public function authenticate(array $credentials)
 {
     list($username, $password) = $credentials;
     $row = $this->db->select('*')->from(self::TABLE_NAME)->where(self::COLUMN_NAME . ' = %s', $username)->fetch();
     if (!$row) {
         throw new AuthenticationException('The username is incorrect.', self::IDENTITY_NOT_FOUND);
     } elseif (!Passwords::verify($password, $row[self::COLUMN_PASSWORD_HASH])) {
         throw new AuthenticationException('The password is incorrect.', self::INVALID_CREDENTIAL);
     } elseif (Passwords::needsRehash($row[self::COLUMN_PASSWORD_HASH])) {
         $row[self::COLUMN_PASSWORD_HASH] = Passwords::hash($password);
     }
     $arr = $row->toArray();
     unset($arr[self::COLUMN_PASSWORD_HASH]);
     return new Identity($row[self::COLUMN_ID], $row[self::COLUMN_ROLE], $arr);
 }
All Usage Examples Of Dibi\Connection::select