* ElggPlugin get() now works with 0. #1286
* Metadata __isset() now works for falsy values (except NULL). #1414
* clear_plugin_setting() now only clears a single setting.
+ * Submenu entries are correctly calculated after a simplecache refresh.
API changes:
* New plugin hook system:unit_test for adding files to unit tests.
* remove_from_river_by_annotation() added.
* unregister_elgg_event_handler() and unregister_plugin_hook() added. #1465
* clear_all_plugin_settings() added.
+ * get_entity_relationships() supports inverse relationships. #1472.
Services API:
* Separated user and api authenticate processing
*
* @param int $guid
*/
-function get_entity_relationships($guid) {
+function get_entity_relationships($guid, $inverse_relationship = FALSE) {
global $CONFIG;
$guid = (int)$guid;
- $query = "SELECT * from {$CONFIG->dbprefix}entity_relationships where guid_one=$guid";
+ $where = ($inverse_relationship ? "guid_two='$guid'" : "guid_one='$guid'");
+
+ $query = "SELECT * from {$CONFIG->dbprefix}entity_relationships where {$where}";
return get_data($query, "row_to_elggrelationship");
}