publicfunction getServiceConfig(){return array('factories'=> array('myServiceClass'=>function(ServiceManager $sm){
$instance =newClass();
$instance->setServiceManager($sm);//Do some other configurationreturn $instance;},),);}//access it using the ServiceManager where you need it
$myService = $sm->get('myService');