src/Resource/ModelHook.php
final public function before(string $action, Record $record, Record $previous = null): bool
    {
        $action = ucfirst($action);
        $method = "before{$action}";
        $container = Container::instance();
        if ($container->exists($this, $method)) {
            return $container->invoke($this, $method, ['record' => $record, 'previous' => $previous]);
        }
        return true;
    }
final public function before(string $action, Record $record, Record $previous = null): bool
    {
        $action = ucfirst($action);
        $method = "before{$action}";
        $container = Container::instance();
        if ($container->exists($this, $method)) {
            return $container->invoke($this, $method, ['record' => $record, 'previous' => $previous]);
        }
        return true;
    }
This method is called before the operation be executed, the changes made in Record will be save
@param string $action
@param Record $record
@param Record $previous
@return bool
@throws SimplesRunTimeError