add class Westdc\Mail\Template

This commit is contained in:
shayupi@qq.com 2014-12-19 14:48:02 +08:00
parent 27beb8fbaf
commit aeb8f034b7
1 changed files with 34 additions and 0 deletions

34
Westdc/Mail/Template.php Normal file
View File

@ -0,0 +1,34 @@
<?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);
}
}