ornament / observer
Observer pattern for Ornament ORM
0.9.0
2016-08-28 16:32 UTC
Requires
- ornament/ornament: ^0.9.0
Requires (Dev)
- gentry/gentry: ^0.10.2
This package is auto-updated.
Last update: 2024-12-15 00:42:54 UTC
README
Observer pattern for Ornament ORM
Installation
Composer (recommended)
$ composer require ornament/observer
Manual
- Download or clone the repo;
- Add
/path/to/observer/src
for namespaceOrnament\Observer
to your PSR-4 autoloader.
Usage
For each Model that needs to observe something, let is use
the
Ornament\Observer\Observer
trait:
<?php use Ornament\Observer\Observer; class ObservingModel { use Observer; }
Similarly, for each Model that needs to be watched, use
the
Ornament\Observer\Subject
trait:
<?php use Ornament\Observer\Subject; class WatchedModel { use Subject; }