You are here

public function FormHelper::valuesChanged in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 src/Form/FormHelper.php \Drupal\simple_sitemap\Form\FormHelper::valuesChanged()
  2. 4.x src/Form/FormHelper.php \Drupal\simple_sitemap\Form\FormHelper::valuesChanged()

Checks if simple_sitemap values have been changed after submitting the form. To be used in an entity form submit.

Parameters

$form:

array $values:

Return value

bool TRUE if simple_sitemap form values have been altered by the user.

File

src/Form/FormHelper.php, line 416

Class

FormHelper
Class FormHelper @package Drupal\simple_sitemap\Form

Namespace

Drupal\simple_sitemap\Form

Code

public function valuesChanged($form, array $values) {
  foreach (self::$valuesToCheck as $field_name) {
    if (isset($values[$field_name]) && $values[$field_name] != $form['simple_sitemap'][$field_name]['#default_value']) {
      return TRUE;
    }
  }
  return FALSE;
}