mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-25 22:09:23 +02:00
33 lines
426 B
PHP
33 lines
426 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Visitor;
|
|
|
|
/**
|
|
* An example of a Visitee : 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;
|
|
}
|
|
|
|
}
|