API Add onBeforeManipulate extension hook

This commit is contained in:
Steve Boyd 2024-04-29 12:28:16 +12:00
parent 3d8dc82d63
commit 6c42463b67

View File

@ -11,6 +11,7 @@ use SilverStripe\ORM\Queries\SQLUpdate;
use SilverStripe\ORM\Queries\SQLInsert; use SilverStripe\ORM\Queries\SQLInsert;
use BadMethodCallException; use BadMethodCallException;
use Exception; use Exception;
use SilverStripe\Core\Extensible;
use SilverStripe\Dev\Backtrace; use SilverStripe\Dev\Backtrace;
/** /**
@ -19,6 +20,7 @@ use SilverStripe\Dev\Backtrace;
*/ */
abstract class Database abstract class Database
{ {
use Extensible;
const PARTIAL_QUERY = 'partial_query'; const PARTIAL_QUERY = 'partial_query';
const FULL_QUERY = 'full_query'; const FULL_QUERY = 'full_query';
@ -386,6 +388,7 @@ abstract class Database
*/ */
public function manipulate($manipulation) public function manipulate($manipulation)
{ {
$this->extend('onBeforeManipulate', $manipulation);
if (empty($manipulation)) { if (empty($manipulation)) {
return; return;
} }