Answer the question
In order to leave comments, you need to log in
How to override dependency injection via setter in descendant?
Good day!
there is an abstract class that defines a setter for dependency injection
abstract class FastDealsCreatingDelegate
{
protected $fastDealsService;
/**
* @required
*
* @param NewFastDealsManagerService $fastDealsService
*/
public function setService(NewFastDealsManagerService $fastDealsService)
{
$this->fastDealsService = $fastDealsService;
}
}
class FastDealsOpenbankPayoutsCreatingDelegate extends FastDealsCreatingDelegate
{
/**
* @required
*
* @param NewFastDealsManagerService $fastDealsService
*/
public function setService(OpenbankPayoutsFastDealsManageService $fastDealsService)
{
$this->fastDealsService = $fastDealsService;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question