Installs: 2 206

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 4


1.0.0 2022-05-02 09:07 UTC

This package is auto-updated.

Last update: 2023-03-16 01:26:55 UTC


This is a temporary fork of tractorcow/silverstripe-proxy-db. Until we can get a CMS5 branch set up there.

Database proxy

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'
    - ProxyDBExtension

Then in your code you can do this


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) {
            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.