diff --git a/src/SecretObject.php b/src/SecretObject.php index 98b1bdf..e00c0e9 100644 --- a/src/SecretObject.php +++ b/src/SecretObject.php @@ -1286,6 +1286,20 @@ public function validate( return $this; } + /** + * Check if a property has a value set. + * + * This method checks if the specified property is set (exists and has a value). It returns true if the property exists and has a value, and false otherwise. + * + * @param string $propertyName The name of the property to check. + * @return bool true if the property is set, false otherwise. + */ + public function hasValue($propertyName) + { + $var = PicoStringUtil::camelize($propertyName); + return isset($this->{$var}); + } + /** * Retrieves a value from a nested object using a series of keys. *