mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-25 22:09:23 +02:00
27 lines
521 B
PHP
27 lines
521 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Behavioral\Mediator;
|
|
|
|
/**
|
|
* Colleague is an abstract colleague who works together but he only knows
|
|
* the Mediator, not other colleagues
|
|
*/
|
|
abstract class Colleague
|
|
{
|
|
/**
|
|
* this ensures no change in subclasses.
|
|
*
|
|
* @var MediatorInterface
|
|
*/
|
|
protected $mediator;
|
|
|
|
/**
|
|
* @param MediatorInterface $mediator
|
|
*/
|
|
public function setMediator(MediatorInterface $mediator)
|
|
{
|
|
$this->mediator = $mediator;
|
|
}
|
|
}
|