0

I have a SoapServer. This soap server has a class

$server = new \SoapServer($this->wsdl_path, array('classmap' => $this->classmap));
$server->setClass('MyNamespace\\MyBundle\\Lib\\MySoapMethods');

And I have the class MySoapMethods which actually contain the methods being executed.

class MySoapMethods
{
  public function sendNotification(NotificationRequest $request) {}
}

The call being made is sendNotification. My question is: How can I inject my EntityManager of Doctrine in here? I can't find any method for this and I really hate using static calls for this.

Anyone
  • 2,814
  • 1
  • 22
  • 27

1 Answers1

2

http://www.php.net/manual/en/soapserver.setclass.php

You can specify more arguments to the setServer method which will be passed to the constructor of the called class.

Harold
  • 1,372
  • 1
  • 14
  • 25