You are here

function name_element_validate_is_empty in Name Field 8

Check if the name element is empty or not.

@group validation

Parameters

array $item: The name element.

Return value

bool TRUE if $item not to contain any data; FALSE otherwise.

1 call to name_element_validate_is_empty()
name_element_validate in ./name.module
A custom validator to check the components of a name element.

File

./name.module, line 670
Defines an API for displaying and inputing names.

Code

function name_element_validate_is_empty(array $item) {
  foreach (_name_translations() as $key => $title) {

    // Title & generational have no meaning by themselves.
    if ($key == 'title' || $key == 'generational') {
      continue;
    }
    if (!empty($item[$key])) {
      return FALSE;
    }
  }
  return TRUE;
}