add ServiceManagerAwareInterface
This commit is contained in:
parent
cc998bc5de
commit
f693f1cf45
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace Westdc\Member;
|
||||
|
||||
use Zend\ServiceManager\ServiceManager;
|
||||
use Zend\ServiceManager\ServiceManagerAwareInterface;
|
||||
use Westdc\EventModel\AbstractEventManager;
|
||||
use Zend\Authentication\AuthenticationService;
|
||||
use Zend\Authentication\Storage\Session as SessionStorage;
|
||||
|
@ -13,7 +15,8 @@ use Westdc\Db\Db as Zend_Db;
|
|||
use Westdc\Mail\Mail;
|
||||
use Westdc\User\Member;
|
||||
|
||||
class Account extends AbstractEventManager
|
||||
|
||||
class Account extends AbstractEventManager implements ServiceManagerAwareInterface
|
||||
{
|
||||
public $memberTable = "tbl_member";
|
||||
public $FieldUsername = "username";
|
||||
|
@ -31,10 +34,24 @@ class Account extends AbstractEventManager
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Db();
|
||||
$this->config = Config::get();
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$dbService = $this->serviceManager->get('Db');
|
||||
$this->db = $dbService->getPdo();
|
||||
}
|
||||
|
||||
public function setServiceManager(ServiceManager $serviceManager)
|
||||
{
|
||||
$this->serviceManager = $serviceManager;
|
||||
|
||||
$this->init();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
//获取账号信息,数组
|
||||
public function getAccountInfo($id = 0)
|
||||
{
|
||||
|
|
|
@ -125,11 +125,4 @@ class Cookie
|
|||
setcookie('scr','',time()-99999,'/');
|
||||
}
|
||||
|
||||
public function getUser()
|
||||
{
|
||||
$sql = "SELECT * FROM ".$this->memberTable." m ORDER BY m.id DESC";
|
||||
$rs = $this->db->query($sql);
|
||||
return $rs->fetchAll();
|
||||
}
|
||||
|
||||
}
|
|
@ -8,9 +8,11 @@
|
|||
|
||||
namespace Westdc\Metadata;
|
||||
|
||||
use Zend\ServiceManager\ServiceManager;
|
||||
use Zend\ServiceManager\ServiceManagerAwareInterface;
|
||||
|
||||
|
||||
class Metadata {
|
||||
class Metadata implements ServiceManagerAwareInterface{
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue