westdc-core/Westdc/Mail/Template.php

34 lines
718 B
PHP
Raw Normal View History

2014-12-19 06:48:02 +00:00
<?php
namespace Westdc\Mail;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
class Template implements ServiceManagerAwareInterface
{
protected $serviceManager;
private $db;
public function setServiceManager(ServiceManager $serviceManager)
{
$this->serviceManager = $serviceManager;
$this->init();
return $this;
}
private function init()
{
$dbService = $this->serviceManager->get('Db');
$this->db = $dbService->getPdo();
}
public function fetchAll()
{
$sql='SELECT * FROM emailtext';
$rs=$this->db->query($sql);
return $rs->fetchAll(\PDO::FETCH_ASSOC);
}
}