]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1325: ElggEntities::countEntitiesFromRelationship() support inverse relationships.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 1 Feb 2010 05:12:57 +0000 (05:12 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 1 Feb 2010 05:12:57 +0000 (05:12 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3880 36083f99-b078-4883-b0ff-0f9b5a30f544

CHANGES.txt
engine/lib/entities.php

index 2e8e658a24649a32146938d59df56163194499f7..e544352ec95dda032b18e8eaed6598b210ee0f8d 100644 (file)
@@ -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
index 7d11f7214d6d46b78bf75af9e99361437757d900..fcf870e13d8c953234b5973d093b6ded1fe10850 100644 (file)
@@ -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);
        }
 
        /**