class LastNameStarDecorator extends LastNameDecorator { private $btd; public function __construct(LastNameDecorator $btd_in) { $this->btd = $btd_in; }
function starLastName() { $this->btd->lastName = Str_replace(" ","*",$this->btd->lastName); } }
$patternName = new Name("A","B");
$decorator = new LastNameDecorator($patternName); $starDecorator = new LastNameStarDecorator($decorator); $exclaimDecorator = new LastNameExclaimDecorator($decorator);