add User service
This commit is contained in:
parent
16e8a7acae
commit
a09322d720
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue