aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/relationships.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/relationships.php')
-rw-r--r--engine/lib/relationships.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 4214c1522..52418e500 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -13,8 +13,10 @@
/**
* Relationship class.
- * @class ElggRelationship
+ *
* @author Marcus Povey
+ * @package Elgg
+ * @subpackage Core
*/
class ElggRelationship implements Importable, Exportable
{
@@ -49,6 +51,12 @@
}
}
+ /**
+ * Class member get overloading
+ *
+ * @param string $name
+ * @return mixed
+ */
protected function __get($name) {
if (isset($this->attributes[$name]))
return $this->attributes[$name];
@@ -56,11 +64,23 @@
return null;
}
+ /**
+ * Class member set overloading
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return mixed
+ */
protected function __set($name, $value) {
$this->attributes[$name] = $value;
return true;
}
+ /**
+ * Save the relationship
+ *
+ * @return int the relationship id
+ */
public function save()
{
if ($this->id > 0)
@@ -84,6 +104,11 @@
}
+ /**
+ * Export this relationship
+ *
+ * @return array
+ */
public function export()
{
$tmp = new stdClass;
@@ -93,6 +118,14 @@
return $tmp;
}
+ /**
+ * Import a relationship
+ *
+ * @param array $data
+ * @param int $version
+ * @return ElggRelationship
+ * @throws ImportException
+ */
public function import(array $data, $version = 1)
{
if ($version == 1)