You are here

function _location_is_full in Location 5

A helper function that tells you whether all the fields of an location are full (excluding the 'additional' field.

Parameters

$location: An associative array where -> The keys are the different field names of an location: 'street', 'additional', 'city', 'province', 'postal_code', and 'country'

Return value

TRUE if there is a non-empty (trimmed) string for the following keys' values: 'street', 'city', 'province', 'postal_code', 'country'. FALSE otherwise.

File

./location.inc, line 494

Code

function _location_is_full($location = array()) {
  if (!isset($location['street']) && trim($location['street']) != '') {
    return FALSE;
  }
  if (!isset($location['city']) && trim($location['city']) != '') {
    return FALSE;
  }
  if (!isset($location['province']) && trim($location['province']) != '') {
    return FALSE;
  }
  if (!isset($location['postal_code']) && trim($location['postal_code']) != '') {
    return FALSE;
  }
  if (!isset($location['country']) && trim($location['country']) != '') {
    return FALSE;
  }
  return TRUE;
}