From: brettp Date: Mon, 1 Feb 2010 05:12:57 +0000 (+0000) Subject: Fixes #1325: ElggEntities::countEntitiesFromRelationship() support inverse relationships. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=234847a4050b615a1cd332472299f865e77a94f9;p=lorea%2Felgg.git Fixes #1325: ElggEntities::countEntitiesFromRelationship() support inverse relationships. git-svn-id: http://code.elgg.org/elgg/trunk@3880 36083f99-b078-4883-b0ff-0f9b5a30f544 --- diff --git a/CHANGES.txt b/CHANGES.txt index 2e8e658a2..e544352ec 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -39,6 +39,7 @@ http://code.elgg.org/elgg/..... * Deprecated search_for_*(). * Deprecated search_list*(). * Added elgg_deprecated_notice(). + * ElggEntity::countEntitiesFromRelationship() supports inverse relationships. #1325 Services API: * Separated user and api authenticate processing diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 7d11f7214..fcf870e13 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -559,11 +559,12 @@ abstract class ElggEntity implements * Gets the number of of entities from a specific relationship type * * @param string $relationship Relationship type (eg "friends") + * @param bool $inverse_relationship * @return int|false The number of entities or false on failure */ - function countEntitiesFromRelationship($relationship) { - return get_entities_from_relationship($relationship, $this->getGUID(), false, "", "", "", - "time_created desc", null, null, true); + function countEntitiesFromRelationship($relationship, $inverse_relationship = FALSE) { + return get_entities_from_relationship($relationship, $this->getGUID(), $inverse_relationship, "", "", "", + "time_created desc", null, null, TRUE); } /**