aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/entities.php38
-rw-r--r--engine/lib/group.php17
-rw-r--r--engine/lib/objects.php17
-rw-r--r--engine/lib/sites.php17
-rw-r--r--engine/lib/users.php17
5 files changed, 38 insertions, 68 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 0985298f7..bf66a0132 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -185,6 +185,44 @@
}
/**
+ * Class member get overloading
+ *
+ * @param string $name
+ * @return mixed
+ */
+ function __get($name) { return $this->get($name); }
+
+ /**
+ * Class member set overloading
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return mixed
+ */
+ function __set($name, $value) { return $this->set($name, $value); }
+
+ /**
+ * Supporting isset.
+ *
+ * @param string $name The name of the attribute or metadata.
+ * @return bool
+ */
+ function __isset($name) { if ($this->$name!="") return true; else return false; }
+
+ /**
+ * Supporting unsetting of magic attributes.
+ *
+ * @param string $name The name of the attribute or metadata.
+ */
+ function __unset($name)
+ {
+ if (array_key_exists($name, $this->attributes))
+ $this->attributes[$name] = "";
+ else
+ $this->clearMetaData($name);
+ }
+
+ /**
* Set a piece of metadata.
*
* @param string $name
diff --git a/engine/lib/group.php b/engine/lib/group.php
index 5c09a93d9..20d98fdbf 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -71,23 +71,6 @@
}
/**
- * Class member get overloading
- *
- * @param string $name
- * @return mixed
- */
- function __get($name) { return $this->get($name); }
-
- /**
- * Class member set overloading
- *
- * @param string $name
- * @param mixed $value
- * @return mixed
- */
- function __set($name, $value) { return $this->set($name, $value); }
-
- /**
* Add an ElggObject to this group.
*
* @param ElggObject $object The object.
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index 530c211bd..69f4f709a 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -77,23 +77,6 @@
throw new InvalidParameterException(elgg_echo('InvalidParameterException:UnrecognisedValue'));
}
}
-
- /**
- * Class member get overloading
- *
- * @param string $name
- * @return mixed
- */
- function __get($name) { return $this->get($name); }
-
- /**
- * Class member set overloading
- *
- * @param string $name
- * @param mixed $value
- * @return mixed
- */
- function __set($name, $value) { return $this->set($name, $value); }
/**
* Override the load function.
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index 8fca0f334..9ad1a7621 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -89,23 +89,6 @@
}
/**
- * Class member get overloading
- *
- * @param string $name
- * @return mixed
- */
- function __get($name) { return $this->get($name); }
-
- /**
- * Class member set overloading
- *
- * @param string $name
- * @param mixed $value
- * @return mixed
- */
- function __set($name, $value) { return $this->set($name, $value); }
-
- /**
* Override the load function.
* This function will ensure that all data is loaded (were possible), so
* if only part of the ElggSite is loaded, it'll load the rest.
diff --git a/engine/lib/users.php b/engine/lib/users.php
index ec247337a..9a4ce2995 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -99,23 +99,6 @@
throw new InvalidParameterException(elgg_echo('InvalidParameterException:UnrecognisedValue'));
}
}
-
- /**
- * Class member get overloading
- *
- * @param string $name
- * @return mixed
- */
- function __get($name) { return $this->get($name); }
-
- /**
- * Class member set overloading
- *
- * @param string $name
- * @param mixed $value
- * @return mixed
- */
- function __set($name, $value) { return $this->set($name, $value); }
/**
* Override the load function.