Example #1
0
 public static function checkUsername($uname)
 {
     $db = new Model();
     $user = $db->findByField($uname, 'users');
     if ($user) {
         return self::instantiate($user);
     } else {
         return false;
     }
 }
Example #2
0
 public static function findComments($pid)
 {
     $db = new Model();
     $comments = $db->findByField(['pid' => $pid], "comments");
     $obj = array();
     foreach ($comments as $c) {
         if ($c->allowed == 1) {
             $obj[] = self::instantiate($c);
         }
     }
     return $obj;
 }