aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggRelationship.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes/ElggRelationship.php')
-rw-r--r--engine/classes/ElggRelationship.php26
1 files changed, 17 insertions, 9 deletions
diff --git a/engine/classes/ElggRelationship.php b/engine/classes/ElggRelationship.php
index 31ef73adb..d2e88882a 100644
--- a/engine/classes/ElggRelationship.php
+++ b/engine/classes/ElggRelationship.php
@@ -4,15 +4,21 @@
*
* @package Elgg.Core
* @subpackage Core
+ *
+ * @property int $id The unique identifier (read-only)
+ * @property int $guid_one The GUID of the subject of the relationship
+ * @property string $relationship The name of the relationship
+ * @property int $guid_two The GUID of the object of the relationship
+ * @property int $time_created A UNIX timestamp of when the relationship was created (read-only, set on first save)
*/
class ElggRelationship extends ElggData implements
Importable
{
/**
- * Construct a new site object, optionally from a given id value or row.
+ * Create a relationship object, optionally from a given id value or row.
*
- * @param mixed $id ElggRelationship id
+ * @param mixed $id ElggRelationship id, database row, or null for new relationship
*/
function __construct($id = null) {
$this->initializeAttributes();
@@ -65,6 +71,7 @@ class ElggRelationship extends ElggData implements
* Save the relationship
*
* @return int the relationship id
+ * @throws IOException
*/
public function save() {
if ($this->id > 0) {
@@ -136,14 +143,13 @@ class ElggRelationship extends ElggData implements
/**
* Import a relationship
*
- * @param array $data ODD data
- *
- * @return ElggRelationship
- *
- * @throws ImportException
+ * @param ODD $data ODD data
+
+ * @return bool
+ * @throws ImportException|InvalidParameterException
*/
public function import(ODD $data) {
- if (!($element instanceof ODDRelationship)) {
+ if (!($data instanceof ODDRelationship)) {
throw new InvalidParameterException(elgg_echo('InvalidParameterException:UnexpectedODDClass'));
}
@@ -171,9 +177,11 @@ class ElggRelationship extends ElggData implements
throw new ImportException(elgg_echo('ImportException:ProblemSaving', array(get_class())));
}
- return $this;
+ return true;
}
}
+
+ return false;
}
// SYSTEM LOG INTERFACE ////////////////////////////////////////////////////////////