You are here

public function LeafletMarker::validate in Leaflet 2.1.x

Same name and namespace in other branches
  1. 8 modules/leaflet_views/src/Plugin/views/row/LeafletMarker.php \Drupal\leaflet_views\Plugin\views\row\LeafletMarker::validate()
  2. 2.0.x modules/leaflet_views/src/Plugin/views/row/LeafletMarker.php \Drupal\leaflet_views\Plugin\views\row\LeafletMarker::validate()

Validate that the plugin is correct and can be saved.

Return value

An array of error strings to tell the user what is wrong with this plugin.

Overrides PluginBase::validate

File

modules/leaflet_views/src/Plugin/views/row/LeafletMarker.php, line 423

Class

LeafletMarker
Plugin which formats a row as a leaflet marker.

Namespace

Drupal\leaflet_views\Plugin\views\row

Code

public function validate() {
  $errors = parent::validate();

  // @todo raise validation error if we have no geofield.
  if (empty($this->options['data_source'])) {
    $errors[] = $this
      ->t('Row @row requires the data source to be configured.', [
      '@row' => $this->definition['title'],
    ]);
  }
  return $errors;
}