public function settingsValidate(Event $event, array $data, ArrayObject $options)
    {
        if (!empty($options['entity']) && $options['entity']->has('name')) {
            $validator = new Validator();
            $this->trigger("Plugin.{$options['entity']->name}.settingsValidate", $data, $validator);
            $errors = $validator->errors($data, $options['entity']->isNew());

            if (!empty($errors)) {
                foreach ($errors as $k => $v) {
                    $options['entity']->errors("settings:{$k}", $v);
                }
            }
        }
    }
public function settingsValidate(Event $event, array $data, ArrayObject $options)
    {
        if (!empty($options['entity']) && $options['entity']->has('name')) {
            $validator = new Validator();
            $this->trigger("Plugin.{$options['entity']->name}.settingsValidate", $data, $validator);
            $errors = $validator->errors($data, $options['entity']->isNew());

            if (!empty($errors)) {
                foreach ($errors as $k => $v) {
                    $options['entity']->errors("settings:{$k}", $v);
                }
            }
        }
    }
public function settingsValidate ( Event $ event , array $ data , ArrayObject $ options ) { if ( ! empty ( $ options [ 'entity' ] ) && $ options [ 'entity' ] -> has ( 'name' ) ) { $ validator = new Validator ( ) ; $ this -> trigger ( "Plugin.{$options['entity']->name}.settingsValidate" , $ data , $ validator ) ; $ errors = $ validator -> errors ( $ data , $ options [ 'entity' ] -> isNew ( ) ) ; if ( ! empty ( $ errors ) ) { foreach ( $ errors as $ k => $ v ) { $ options [ 'entity' ] -> errors ( "settings:{$k}" , $ v ) ; } } } }
Validates plugin 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 plugin settings before persisted in DB .