PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Rodrigo Faustino   Observe   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Observe
Control product stocks with the observer pattern
Author: By
Last change:
Date: 3 months ago
Size: 528 bytes
 

Contents

Class file image Download
<?php

require 'vendor/autoload.php';
 use
Estoque\App\ControleEstoqueSubject;
 use
Estoque\App\ControleRequisicoesCompraObserver;
 use
Estoque\App\EmailObserver;

$controleEstoqueSubject = new ControleEstoqueSubject();
 
$controleRequisicaoCompraObserver = new ControleRequisicoesCompraObserver();
$emailObserver = new EmailObserver();

$controleEstoqueSubject->adicionarObserver($controleRequisicaoCompraObserver);
//$controleEstoqueSubject->adicionarObserver($emailObserver);

$controleEstoqueSubject->notificarObservers(13);