mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-28 10:40:17 +02:00
31 lines
433 B
PHP
31 lines
433 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Behavioral\Visitor;
|
|
|
|
/**
|
|
* An example of a Visitor: Group.
|
|
*/
|
|
class Group extends Role
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $name;
|
|
|
|
/**
|
|
* @param string $name
|
|
*/
|
|
public function __construct($name)
|
|
{
|
|
$this->name = (string) $name;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return 'Group: '.$this->name;
|
|
}
|
|
}
|