aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt1
-rw-r--r--engine/lib/entities.php12
2 files changed, 13 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 43d4cc9ff..3119b4703 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -41,6 +41,7 @@ http://code.elgg.org/elgg/.....
* Added elgg_deprecated_notice().
* ElggEntity::countEntitiesFromRelationship() supports inverse relationships. #1325
* delete_relationship() triggers the hook delete:relationship and passes the relationship object. #1213
+ * added ElggEntity::removeRelationship(). #1376.
Services API:
* Separated user and api authenticate processing
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 7d8a6b90a..3cabd93ca 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -416,12 +416,24 @@ abstract class ElggEntity implements
*
* @param int $guid Relationship to link to.
* @param string $relationship The type of relationship.
+ * @return bool
*/
public function addRelationship($guid, $relationship) {
return add_entity_relationship($this->getGUID(), $relationship, $guid);
}
/**
+ * Remove a relationship
+ *
+ * @param int $guid
+ * @param str $relationship
+ * @return bool
+ */
+ public function removeRelationship($guid, $relationship) {
+ return remove_entity_relationship($this->getGUID(), $relationship, $guid);
+ }
+
+ /**
* Adds a private setting to this entity.
*
* @param $name