mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
20 lines
552 B
PHP
20 lines
552 B
PHP
|
<?php
|
||
|
|
||
|
namespace SilverStripe\FullTextSearch\Search\Extensions;
|
||
|
|
||
|
use SilverStripe\Core\Extension;
|
||
|
use TractorCow\ClassProxy\Generators\ProxyGenerator;
|
||
|
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
|
||
|
|
||
|
class ProxyDBExtension extends Extension
|
||
|
{
|
||
|
public function updateProxy(ProxyGenerator &$proxy)
|
||
|
{
|
||
|
$proxy = $proxy->addMethod('manipulate', function ($args, $next) {
|
||
|
$manipulation = $args[0];
|
||
|
SearchUpdater::handle_manipulation($manipulation);
|
||
|
return $next(...$args);
|
||
|
});
|
||
|
}
|
||
|
}
|