original_string: 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);
                  }
              }
          }
      }
code: 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);
                  }
              }
          }
      }
code_tokens: 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 ) ; } } } }
docstring: 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
docstring_tokens: Validates plugin settings before persisted in DB .