-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.php
More file actions
23 lines (19 loc) · 680 Bytes
/
Copy pathmain.php
File metadata and controls
23 lines (19 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
use Imaarov\Patterns\Behavioral\Observer\Observer\Admin;
use Imaarov\Patterns\Behavioral\Observer\Observer\User;
use Imaarov\Patterns\Behavioral\Observer\Subscription;
class Main {
public function __construct()
{
$subscription = new Subscription();
$user1 = new User();
$user2 = new User();
$admin = new Admin();
# Add Observers to subscription
$subscription->addObserver($user1);
$subscription->addObserver($user2);
$subscription->addObserver($admin);
# Change the popUp Value that cause the notification to all observers
$subscription->setPopUp(true);
}
}