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