Hide extra vars with no value #2486

This commit is contained in:
Kijin Sung 2025-02-15 21:49:36 +09:00
parent 7d6565766a
commit 4bf4aca762
4 changed files with 24 additions and 4 deletions

View file

@ -121,6 +121,24 @@ class Value
$this->value = $value;
}
/**
* Check if this extra variable has a value.
*
* @return bool
*/
public function hasValue(): bool
{
$value = self::_getTypeValue($this->type, $this->value);
if ($value === null || $value === '' || (is_array($value) && !count($value)))
{
return false;
}
else
{
return true;
}
}
/**
* Get the raw value.
*