kod ponizej, w którym próbuję wywołać
$this->getServiceLocator()->get('Zend\Db\Adapter\Adapter');
lecz niestety dostaje odpowiedź że nie ma takiej metody jak getServiceLocator ... w kontrolerze tak się odwołuję i nie mam problemu.... (ten sam moduł)
<?php namespace Login\Model; use Zend\Authentication\Adapter\AdapterInterface; use Zend\Authentication\Result as AuthResult; class CustomAdapter implements AdapterInterface { protected $customer; protected $login; protected $password; protected $adapter; public function getAdapter() { if (!$this->adapter) { $this->adapter = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter'); } return $this->adapter; } /** * @return \Zend\Authentication\Result */ public function authenticate() { $this->getAdapter(); / } public function setCustomer($data) { $this->customer = $data; } public function setLogin($data) { $this->login = $data; } public function setPassword($data) { } }