我有一个肥皂服务器。这个肥皂服务器有一个类
$server = new \SoapServer($this->wsdl_path, array('classmap' => $this->classmap));
$server->setClass('MyNamespace\\MyBundle\\Lib\\MySoapMethods');
我有 MySoapMethods 类,它实际上包含正在执行的方法。
class MySoapMethods
{
public function sendNotification(NotificationRequest $request) {}
}
正在进行的调用是 sendNotification。我的问题是:如何在这里注入我的 EntityManager of Doctrine?我找不到任何方法,我真的很讨厌为此使用静态调用。