add mediator pattern in php