mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-19 13:01:24 +02:00
PHP7 Memento
This commit is contained in:
@@ -6,8 +6,8 @@ Purpose
|
||||
|
||||
It provides the ability to restore an object to it's previous state (undo
|
||||
via rollback) or to gain access to state of the object, without revealing
|
||||
it's implementation (i.e., the object is not required to have a functional
|
||||
for return the current state).
|
||||
it's implementation (i.e., the object is not required to have a function
|
||||
to return the current state).
|
||||
|
||||
The memento pattern is implemented with three objects: the Originator, a
|
||||
Caretaker and a Memento.
|
||||
@@ -66,9 +66,9 @@ Originator.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
Caretaker.php
|
||||
Ticket.php
|
||||
|
||||
.. literalinclude:: Caretaker.php
|
||||
.. literalinclude:: Ticket.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
|
Reference in New Issue
Block a user