public static function Check::notEmpty in Hook Update Deploy Tools 7
Same name and namespace in other branches
- 8 src/Check.php \HookUpdateDeployTools\Check::notEmpty()
A strict check for !empty. Fails update if $value is empty.
Parameters
string $name: The name of a variable being checked for empty.
mixed $value: The actual value of the variable being checked for empty.
Return value
bool TRUE if $value is not empty.
Throws
HudtException if it is empty.
19 calls to Check::notEmpty()
- Blocks::disable in src/
Blocks.php - Disables a block for a specific theme.
- Blocks::enable in src/
Blocks.php - Enables and sets the region for a block in a specific theme.
- Blocks::load in src/
Blocks.php - Loads a block object.
- Blocks::updateInstancePropertiesSilent in src/
Blocks.php - Updates a block with any specified properties.
- Fields::deleteInstance in src/
Fields.php - Deletes an instance of a field from and entity bundle.
File
- src/
Check.php, line 98 - File for methods related to strictly checking things.
Class
- Check
- Public methods for dealing with Checking things.
Namespace
HookUpdateDeployToolsCode
public static function notEmpty($name, $value) {
if (!empty($value)) {
$return = TRUE;
}
else {
// This is strict, so make message and throw DrupalUpdateException.
$message = 'The required !name was empty. Could not proceed.';
$vars = array(
'!name' => $name,
);
throw new HudtException($message, $vars, WATCHDOG_ERROR, TRUE);
}
return $return;
}