34 lines
718 B
PHP
34 lines
718 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|