add User service

This commit is contained in:
Jianxuan Li 2014-12-19 10:25:49 +08:00
parent 16e8a7acae
commit a09322d720
1 changed files with 24 additions and 1 deletions

View File

@ -8,8 +8,31 @@
namespace Westdc\User;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Westdc\EventModel\AbstractEventManager;
class User extends AbstractEventManager implements ServiceManagerAwareInterface{
class User {
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();
}
}