mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-13 03:16:21 +02:00
Merge pull request #17 from scoumbourdis/cb4a9de3be436bb5ae1f1d9460dab449e137ae07
A simple example for Observer Pattern
This commit is contained in:
@ -87,3 +87,8 @@ class User implements \SplSubject
|
|||||||
$this->notify();
|
$this->notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$user = new User();
|
||||||
|
$user->attach(new UserObserver());
|
||||||
|
|
||||||
|
$user->notify();
|
||||||
|
Reference in New Issue
Block a user