diff options
Diffstat (limited to 'src/decorators/IfEmptyDecorator.php')
-rw-r--r-- | src/decorators/IfEmptyDecorator.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/decorators/IfEmptyDecorator.php b/src/decorators/IfEmptyDecorator.php index 8116773d..9689825e 100644 --- a/src/decorators/IfEmptyDecorator.php +++ b/src/decorators/IfEmptyDecorator.php @@ -8,6 +8,12 @@ namespace PHPPgAdmin\Decorators; class IfEmptyDecorator extends Decorator { + public $val; + public $empty; + /** + * @var mixed + */ + public $full; public function __construct($value, $empty, $full = null) { $this->val = $value; @@ -26,6 +32,6 @@ class IfEmptyDecorator extends Decorator return Decorator::get_sanitized_value($this->empty, $fields); } - return isset($this->full) ? Decorator::get_sanitized_value($this->full, $fields) : $val; + return property_exists($this, 'full') && $this->full !== null ? Decorator::get_sanitized_value($this->full, $fields) : $val; } } |