public function loadBySlug(SiteModel $site, $slug) { global $DB; $stat = $DB->prepare("SELECT send_email_information.* FROM send_email_information WHERE slug =:slug AND site_id =:sid"); $stat->execute(array('sid' => $site->getId(), 'slug' => $slug)); if ($stat->rowCount() > 0) { $sem = new SendEmailModel(); $sem->setFromDataBaseRow($stat->fetch()); return $sem; } }
public function fetchAll() { $this->buildStart(); $this->build(); $this->buildStat(); $results = array(); while ($data = $this->stat->fetch()) { $sendemail = new SendEmailModel(); $sendemail->setFromDataBaseRow($data); $results[] = $sendemail; } return $results; }