mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Hide extra vars with no value #2486
This commit is contained in:
parent
7d6565766a
commit
4bf4aca762
4 changed files with 24 additions and 4 deletions
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue