OrderDataSubject
in package
implements
SplSubject
Class OrderDataSubject
Tags
Interfaces, Classes and Traits
- SplSubject
Table of Contents
- $dataChange : DataChange
- $factory : DataObserverFactory
- $idColumn : string
- $observers : SplObjectStorage
- $table : string
- __construct() : mixed
- OrderDataSubject constructor.
- attach() : void
- Attach an SplObserver.
- change() : void
- Change the current value of the subject.
- detach() : void
- Detach an observer.
- getDataChange() : DataChange
- Get the subject's DataChange object.
- notify() : void
- Notify an observer.
Properties
$dataChange
protected
DataChange
$dataChange
$factory
protected
DataObserverFactory
$factory
$idColumn
protected
string
$idColumn
= 'orders_id'
$observers
protected
SplObjectStorage
$observers
$table
protected
string
$table
= 'orders'
Methods
__construct()
OrderDataSubject constructor.
public
__construct(DataObserverFactory $factory[, array<string|int, mixed> $observers = [] ]) : mixed
Parameters
- $factory : DataObserverFactory
- $observers : array<string|int, mixed> = []
Return values
mixed —attach()
Attach an SplObserver.
public
attach(SplObserver $observer) : void
Parameters
- $observer : SplObserver
-
The SplObserver to attach.
Tags
Return values
void —change()
Change the current value of the subject.
public
change(string $action, int $rowId) : void
Calling this method will also notify all attached observers.
Parameters
- $action : string
-
Executed function, provide one of 'insert', 'update' or 'delete'.
- $rowId : int
-
Changed row ID.
Return values
void —detach()
Detach an observer.
public
detach(SplObserver $observer) : void
Parameters
- $observer : SplObserver
-
The SplObserver to detach.
Tags
Return values
void —getDataChange()
Get the subject's DataChange object.
public
getDataChange() : DataChange
Return values
DataChange —notify()
Notify an observer.
public
notify() : void