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