/**
  * Returns defined fields.
  *
  * @return array
  *   A list of address field definitions.
  * @throws UcAddressesUndefinedFunctionException
  *   In case the function uc_addresses_get_address_fields()
  *   does not exists.
  */
 public static function getDefinedFields()
 {
     if (!function_exists('uc_addresses_get_address_fields')) {
         throw new UcAddressesUndefinedFunctionException('Function uc_addresses_get_address_fields() does not exists.');
     }
     return uc_addresses_get_address_fields();
 }
 /**
  * Checks if the field passes the context.
  *
  * @access public
  * @return boolean
  *   TRUE if the field passes the context.
  *   FALSE otherwise.
  */
 public function checkContext()
 {
     $fields = uc_addresses_get_address_fields();
     if (isset($fields[$this->name])) {
         $display_settings = $fields[$this->name]['display_settings'];
         if (!isset($display_settings[$this->context]) && $display_settings['default'] || isset($display_settings[$this->context]) && $display_settings[$this->context] == TRUE) {
             return TRUE;
         }
         return FALSE;
     }
     return TRUE;
 }