add class Westdc\Mail\Template
This commit is contained in:
parent
27beb8fbaf
commit
aeb8f034b7
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue