ZF2: jak uzyskać instancję ServiceManager z poziomu klasy niestandardowej

Mam problem z ustaleniem, jak uzyskać instancję ServiceManager z poziomu klasy niestandardowej.

W kontrolerze jest łatwo:

$this->getServiceLocator()->get('My\CustomLogger')->log(5, 'my message');

Teraz stworzyłem kilka niezależnych klas i muszę je odzyskaćZend\Log instancja wewnątrz tej klasy. W zend framework v.1 zrobiłem to przez wywołanie statyczne:

Zend_Registry::get('myCustomLogger');

Jak mogę odzyskaćMy\CustomLogger w ZF2?

questionAnswers(1)

yourAnswerToTheQuestion