}
}
- /**
- * Class member get overloading
- *
- * @param string $name The name of the value to get
- *
- * @return mixed
- */
- function __get($name) {
- return $this->get($name);
- }
-
- /**
- * Class member set overloading
- *
- * @param string $name The name of the value to set
- * @param mixed $value The value to set
- *
- * @return mixed
- */
- function __set($name, $value) {
- return $this->set($name, $value);
- }
-
/**
* Save this instance
*
$this->attributes['time_created'] = '';
}
+
+ /**
+ * Return an attribute or a piece of metadata.
+ *
+ * @param string $name Name
+ *
+ * @return mixed
+ */
+ public function __get($name) {
+ return $this->get($name);
+ }
+
+ /**
+ * Set an attribute or a piece of metadata.
+ *
+ * @param string $name Name
+ * @param mixed $value Value
+ *
+ * @return mixed
+ */
+ public function __set($name, $value) {
+ return $this->set($name, $value);
+ }
+
+ /**
+ * Test if property is set either as an attribute or metadata.
+ *
+ * @tip Use isset($entity->property)
+ *
+ * @param string $name The name of the attribute or metadata.
+ *
+ * @return bool
+ */
+ function __isset($name) {
+ return $this->$name !== NULL;
+ }
+
+ abstract protected function get($name);
+
+ abstract protected function set($name, $value);
+
/**
* Get a URL for this object
*
return null;
}
- /**
- * Return an attribute or a piece of metadata.
- *
- * @param string $name Name
- *
- * @return mixed
- */
- function __get($name) {
- return $this->get($name);
- }
-
- /**
- * Set an attribute or a piece of metadata.
- *
- * @param string $name Name
- * @param mixed $value Value
- *
- * @return mixed
- */
- function __set($name, $value) {
- return $this->set($name, $value);
- }
-
- /**
- * Test if property is set either as an attribute or metadata.
- *
- * @tip Use isset($entity->property)
- *
- * @param string $name The name of the attribute or metadata.
- *
- * @return bool
- */
- function __isset($name) {
- return $this->$name !== NULL;
- }
-
/**
* Unset a property from metadata or attribute.
*
}
}
- /**
- * Class member get overloading
- *
- * @param string $name Name
- *
- * @return mixed
- */
- function __get($name) {
- return $this->get($name);
- }
-
- /**
- * Class member set overloading
- *
- * @param string $name Name
- * @param mixed $value Value
- *
- * @return mixed
- */
- function __set($name, $value) {
- return $this->set($name, $value);
- }
-
/**
* Determines whether or not the user can edit this piece of metadata
*
*
* @return mixed
*/
- function __get($name) {
+ function get($name) {
if (isset($this->attributes[$name])) {
return $this->attributes[$name];
}
*
* @return mixed
*/
- function __set($name, $value) {
+ function set($name, $value) {
$this->attributes[$name] = $value;
return true;
}