PHP code example of xianghua_we / dbevent-observer
1. Go to this page and download the library: Download xianghua_we/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/ */
xianghua_we / dbevent-observer example snippets
namespace xianghua_we\dbeventObserver\examples;
use xianghua_we\dbeventObserver\interfaces\SplSubject;
use xianghua_we\dbeventObserver\SplSubjectEnforcer;
class ExampleModel implements SplSubject
{
use SplSubjectEnforcer;
}
namespace xianghua_we\dbeventObserver\examples;
use xianghua_we\dbeventObserver\interfaces\SplObserver;
use xianghua_we\dbeventObserver\interfaces\SplSubject;
class ExampleObServer implements SplObserver
{
public function update(SplSubject $subject): void
{
// TODO: Implement update() method.
// 打印修改的数据 根据要修改的数据,进行业务处理
var_dump($subject->getSplUpdateData());
}
}