1. Go to this page and download the library: Download teamones/dbevent-observer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
teamones / dbevent-observer example snippets
namespace teamones\dbeventObserver\examples;
use teamones\dbeventObserver\interfaces\SplSubject;
use teamones\dbeventObserver\SplSubjectEnforcer;
class ExampleModel implements SplSubject
{
use SplSubjectEnforcer;
}
namespace teamones\dbeventObserver\examples;
use teamones\dbeventObserver\interfaces\SplObserver;
use teamones\dbeventObserver\interfaces\SplSubject;
class ExampleObServer implements SplObserver
{
public function update(SplSubject $subject): void
{
// TODO: Implement update() method.
// 打印修改的数据 根据要修改的数据,进行业务处理
var_dump($subject->getSplUpdateData());
}
}