public function settingsValidate(Event $event, array $data, ArrayObject $options)
    {
        if (!empty($options['entity']) && $options['entity']->has('handler')) {
            $block = $options['entity'];

            if (!$block->isCustom()) {
                $validator = new Validator();
                $block->validateSettings($data, $validator);
                $errors = $validator->errors((array)$data);
                foreach ($errors as $k => $v) {
                    $block->errors("settings:{$k}", $v);
                }
            }
        }
    }
public function settingsValidate(Event $event, array $data, ArrayObject $options)
    {
        if (!empty($options['entity']) && $options['entity']->has('handler')) {
            $block = $options['entity'];

            if (!$block->isCustom()) {
                $validator = new Validator();
                $block->validateSettings($data, $validator);
                $errors = $validator->errors((array)$data);
                foreach ($errors as $k => $v) {
                    $block->errors("settings:{$k}", $v);
                }
            }
        }
    }
public function settingsValidate ( Event $ event , array $ data , ArrayObject $ options ) { if ( ! empty ( $ options [ 'entity' ] ) && $ options [ 'entity' ] -> has ( 'handler' ) ) { $ block = $ options [ 'entity' ] ; if ( ! $ block -> isCustom ( ) ) { $ validator = new Validator ( ) ; $ block -> validateSettings ( $ data , $ validator ) ; $ errors = $ validator -> errors ( ( array ) $ data ) ; foreach ( $ errors as $ k => $ v ) { $ block -> errors ( "settings:{$k}" , $ v ) ; } } } }
Validates block settings before persisted in DB.

@param \Cake\Event\Event $event The event that was triggered
@param array $data Information to be validated
@param \ArrayObject $options Options given to pathEntity()
@return void
Validates block settings before persisted in DB .