user ser modify
This commit is contained in:
parent
9bc2e4e065
commit
60e3d2e97a
|
@ -11,37 +11,35 @@ namespace Westdc\User;
|
||||||
use Zend\ServiceManager\ServiceManager;
|
use Zend\ServiceManager\ServiceManager;
|
||||||
use Zend\ServiceManager\ServiceManagerAwareInterface;
|
use Zend\ServiceManager\ServiceManagerAwareInterface;
|
||||||
|
|
||||||
class Group implements ServiceManagerAwareInterface{
|
class Group implements ServiceManagerAwareInterface {
|
||||||
|
|
||||||
protected $serviceManager;
|
protected $serviceManager;
|
||||||
|
|
||||||
private $db;
|
private $db;
|
||||||
|
|
||||||
public function setServiceManager(ServiceManager $serviceManager)
|
public function setServiceManager (ServiceManager $serviceManager) {
|
||||||
{
|
$this->serviceManager = $serviceManager;
|
||||||
$this->serviceManager = $serviceManager;
|
|
||||||
|
|
||||||
$this->init();
|
$this->init();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function init()
|
private function init () {
|
||||||
{
|
$dbService = $this->serviceManager->get('Db');
|
||||||
$dbService = $this->serviceManager->get('Db');
|
$this->db = $dbService->getPdo();
|
||||||
$this->db = $dbService->getPdo();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function fetchAll () {
|
public function fetchAll () {
|
||||||
|
|
||||||
$sql = "SELECT * FROM groups";
|
$sql = "SELECT * FROM groups";
|
||||||
$rs = $this->db->query($sql);
|
$rs = $this->db->query($sql);
|
||||||
|
|
||||||
return $rs->fetchAll(\PDO::FETCH_ASSOC);
|
return $rs->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -71,5 +71,4 @@ class User extends AbstractEventManager implements ServiceManagerAwareInterface
|
||||||
return $rs->fetchAll(\PDO::FETCH_ASSOC);
|
return $rs->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue