DOCS Add doc blocks for ProxyDBExtension

This commit is contained in:
Raissa North 2018-03-15 09:45:14 +13:00
parent e7420a584d
commit 08052436e8
2 changed files with 14 additions and 1 deletions

View File

@ -6,8 +6,21 @@ use SilverStripe\Core\Extension;
use TractorCow\ClassProxy\Generators\ProxyGenerator;
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
/**
* Class ProxyDBExtension
* @package SilverStripe\FullTextSearch\Search\Extensions
*
* This database connector proxy will allow {@link SearchUpdater::handle_manipulation} to monitor database schema
* changes that may need to be propagated through to search indexes.
*
*/
class ProxyDBExtension extends Extension
{
/**
* @param ProxyGenerator $proxy
*
* Ensure the search index is kept up to date by monitoring SilverStripe database manipulations
*/
public function updateProxy(ProxyGenerator &$proxy)
{
$proxy = $proxy->addMethod('manipulate', function ($args, $next) {

View File

@ -42,7 +42,7 @@ class SearchUpdater
public static $processor = null;
/**
* Called by the SearchManiplateCapture database adapter with every manipulation made against the database.
* Called by the ProxyDBExtension database connector with every manipulation made against the database.
*
* Check every index to see what objects need re-inserting into what indexes to keep the index fresh,
* but doesn't actually do it yet.