You are here

public static function ProfileCompleteProfileController::isFieldEmpty in Complete profile 7

1 call to ProfileCompleteProfileController::isFieldEmpty()
ProfileCompleteProfileController::getFieldsForm in includes/ProfileCompleteProfileController.php

File

includes/ProfileCompleteProfileController.php, line 4

Class

ProfileCompleteProfileController

Code

public static function isFieldEmpty($account, $field) {
  if (!isset($account->{$field->name})) {
    return TRUE;
  }
  $value = $account->{$field->name};
  switch ($field->type) {
    case _profile_field_serialize($field->type):
    case 'checkbox':
      return empty($value);
    default:
      return !drupal_strlen(trim($value));
  }
}