Example #1
0
 /**
  * Get a site's comments.
  * @uses \ReusingDublin\Controller::sanatizeArray()
  * @param integer $siteId The site id.
  * @return array Returns an array of data.
  */
 public static function getComments($siteId)
 {
     $db = Model::factory()->getDb();
     $qry = "SELECT * FROM Comment\n            WHERE site_id=:site_id";
     //query db
     $sth = $db->prepare($qry);
     $sth->execute(array(':site_id' => $siteId));
     $res = $sth->fetchAll(\PDO::FETCH_ASSOC);
     $res = Controller::sanatizeArray($res);
     return $res;
 }