* @param int $offset Place to start.\r
* @param string $order_by How to order results.\r
* @param boolean $count Whether to count entities rather than return them\r
+ * @param int $timelower The earliest time the annotation can have been created. Default: all\r
+ * @param int $timeupper The latest time the annotation can have been created. Default: all\r
*/\r
- function get_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "", $value = "", $owner_guid = 0, $group_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $count = false)\r
+ function get_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "", $value = "", $owner_guid = 0, $group_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $count = false, $timelower = 0, $timeupper = 0)\r
{\r
global $CONFIG;\r
\r
$entity_type = sanitise_string($entity_type);\r
$entity_subtype = get_subtype_id($entity_type, $entity_subtype);\r
+ $timelower = (int) $timelower;\r
+ $timeupper = (int) $timeupper;\r
+ \r
if ($name)\r
{\r
$name = get_metastring_id($name);\r
\r
if ($value != "")\r
$where[] = "a.value_id='$value'";\r
- \r
+\r
+ if ($timelower)\r
+ $where[] = "a.time_created >= {$timelower}";\r
+ if ($timeupper)\r
+ $where[] = "a.time_created <= {$timeupper}";\r
\r
if ($count) {\r
$query = "SELECT count(distinct e.guid) as total ";\r