Browse Source

Added __isset and __unset to Fluent

Signed-off-by: Phill Sparks <me@phills.me.uk>
Phill Sparks 12 years ago
parent
commit
f27027d3a8
1 changed files with 16 additions and 0 deletions
  1. 16 0
      laravel/fluent.php

+ 16 - 0
laravel/fluent.php

@@ -77,4 +77,20 @@ class Fluent {
 		$this->attributes[$key] = $value;
 	}
 
+	/**
+	 * Dynamically check if an attribute is set.
+	 */
+	public function __isset($key)
+	{
+		return isset($this->attributes[$key]);
+	}
+
+	/**
+	 * Dynamically unset an attribute.
+	 */
+	public function __unset($key)
+	{
+		return unset($this->attributes[$key]);
+	}
+
 }