mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-13 01:45:31 +02:00
21 lines
437 B
PHP
21 lines
437 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Behavioral\Observer;
|
|
|
|
/**
|
|
* class UserObserver
|
|
*/
|
|
class UserObserver implements \SplObserver
|
|
{
|
|
/**
|
|
* This is the only method to implement as an observer.
|
|
* It is called by the Subject (usually by SplSubject::notify() )
|
|
*
|
|
* @param \SplSubject $subject
|
|
*/
|
|
public function update(\SplSubject $subject)
|
|
{
|
|
echo get_class($subject) . ' has been updated';
|
|
}
|
|
}
|