mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 01:32:22 +01:00
26 lines
367 B
PHP
26 lines
367 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Behavioral\Memento;
|
|
|
|
class Memento
|
|
{
|
|
/* @var mixed */
|
|
private $state;
|
|
|
|
/**
|
|
* @param mixed $stateToSave
|
|
*/
|
|
public function __construct($stateToSave)
|
|
{
|
|
$this->state = $stateToSave;
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getState()
|
|
{
|
|
return $this->state;
|
|
}
|
|
}
|