Exemplo n.º 1
0
 public function exists()
 {
     return false !== Sdb::fetchRow('id', static::table(), $this->selfCond());
 }
Exemplo n.º 2
0
 public static function check($username, $password)
 {
     $conds = array('username=? AND password=?' => array($username, md5($password)));
     $info = Sdb::fetchRow('*', self::table(), $conds);
     return $info ? new self($info) : false;
 }
Exemplo n.º 3
0
 public function commentedByUser(User $user)
 {
     $conds = array('user=? AND teacher=?' => array($user->id, $this->id));
     $id = Sdb::fetchRow('id', Comment::table(), $conds);
     return $id ? new Comment($id) : false;
 }