Datelist::checkEmptyInputs

protected static Datelist::checkEmptyInputs($input, $parts)

Checks the input array for empty values.

Input array keys are checked against values in the parts array. Elements not in the parts array are ignored. Returns an array representing elements from the input array that have no value. If no empty values are found, returned array is empty.

Parameters

array $input: Array of individual inputs to check for value.

array $parts: Array to check input against, ignoring elements not in this array.

Return value

array Array of keys from the input array that have no value, may be empty.

File

core/lib/Drupal/Core/Datetime/Element/Datelist.php, line 351

Class

Datelist
Provides a datelist element.

Namespace

Drupal\Core\Datetime\Element

Code

protected static function checkEmptyInputs($input, $parts) {
  // Filters out empty array values, any valid value would have a string length.
  $filtered_input = array_filter($input, 'strlen');
  return array_diff($parts, array_keys($filtered_input));
}
doc_Drupal
2016-10-29 09:00:53
Comments
Leave a Comment

Please login to continue.