tractorcow/silverstripe-proxy-db
最新稳定版本:3.0.0
Composer 安装命令:
composer require tractorcow/silverstripe-proxy-db
包简介
关键字:
README 文档
README
Ok, so you want to proxy the database.
Install this module, and decorate the factory with code you want to extend
--- Name: myproxydb After: '#proxydb' --- TractorCow\SilverStripeProxyDB\ProxyDBFactory: extensions: - ProxyDBExtension
Then in your code you can do this
<?php use SilverStripe\Core\Extension; use TractorCow\ClassProxy\Generators\ProxyGenerator; class ProxyDBExtension extends Extension { public function updateProxy(ProxyGenerator &$proxy) { $proxy = $proxy->addMethod('manipulate', function ($args, $next) { SearchManipulator::manipulate($args[0]); return $next(...$args); }); } }
You can chain methods; All addMethod() calls on the same method name will form a set of middleware. First methods registered are executed first.
统计信息
- 总下载量: 477.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 8
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-02-16