예제 #1
0
 static function get_by_person($p)
 {
     if (!is_a($p, 'Person') || intval($p->id) == 0) {
         return false;
     }
     $db = Get::db('songwork');
     $db->query("SELECT * FROM admins WHERE person_id=" . $p->id);
     if ($db->num_rows() == 0) {
         return false;
     }
     $x = new Administrator($db->next_record());
     $x->set_person($p);
     return $x;
 }