예제 #1
0
 public function get_links_by_uid($uid)
 {
     $res = $this->connection->query("SELECT * FROM links WHERE uid = {$uid}", PDO::FETCH_LAZY);
     $links = array();
     $i = 0;
     foreach ($res as $row) {
         $cur_link = new Link_Model();
         $cur_link->set_title($row['title']);
         $cur_link->set_link($row['link']);
         $cur_link->set_description($row['description']);
         $cur_link->set_privacy_status($row['privacy_status']);
         $cur_link->set_uid($row['uid']);
         $cur_link->set_lid($row['lid']);
         $links[$i] = $cur_link;
         $i++;
     }
     return $links;
 }