mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-23 17:22:41 +01:00
31 lines
434 B
PHP
31 lines
434 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;
|
|
}
|
|
}
|