westdc-core/Westdc/User/User.php

38 lines
716 B
PHP

<?php
/**
* Created by PhpStorm.
* User: Li Jianxuan
* Date: 14-9-19
* Time: 下午3:21
*/
namespace Westdc\User;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Westdc\EventModel\AbstractEventManager;
class User extends AbstractEventManager 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();
}
}