public function getByAreaAndSlug(AreaModel $area, $slug) { global $DB; $stat = $DB->prepare("SELECT area_comment_information.* FROM area_comment_information " . " WHERE area_comment_information.area_id =:area_id AND area_comment_information.slug = :slug "); $stat->execute(array('area_id' => $area->getId(), 'slug' => $slug)); if ($stat->rowCount() > 0) { $a = new AreaCommentModel(); $a->setFromDataBaseRow($stat->fetch()); return $a; } }
public function fetchAll() { $this->buildStart(); $this->build(); $this->buildStat(); $results = array(); while ($data = $this->stat->fetch()) { $ecm = new AreaCommentModel(); $ecm->setFromDataBaseRow($data); $results[] = $ecm; } return $results; }