diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-08-03 20:27:55 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-08-03 20:27:55 +0000 |
commit | bcd4242a32c0b765156a0672d82e9bd086e80e0a (patch) | |
tree | 20074fab6fd9e2320b31a95ad1c4156d9d4ae515 /engine/lib | |
parent | 3389990c9e541fdf906293df79da04f05cf16792 (diff) | |
download | elgg-bcd4242a32c0b765156a0672d82e9bd086e80e0a.tar.gz elgg-bcd4242a32c0b765156a0672d82e9bd086e80e0a.tar.bz2 |
Added starttime and endtime for get_entities_from_annotation().
git-svn-id: https://code.elgg.org/elgg/trunk@3418 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/annotations.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index af28a6aff..23109cbf6 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -355,13 +355,18 @@ * @param int $offset Place to start.
* @param string $order_by How to order results.
* @param boolean $count Whether to count entities rather than return them
+ * @param int $timelower The earliest time the annotation can have been created. Default: all
+ * @param int $timeupper The latest time the annotation can have been created. Default: all
*/
- 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)
+ 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)
{
global $CONFIG;
$entity_type = sanitise_string($entity_type);
$entity_subtype = get_subtype_id($entity_type, $entity_subtype);
+ $timelower = (int) $timelower;
+ $timeupper = (int) $timeupper;
+
if ($name)
{
$name = get_metastring_id($name);
@@ -414,7 +419,11 @@ if ($value != "")
$where[] = "a.value_id='$value'";
-
+
+ if ($timelower)
+ $where[] = "a.time_created >= {$timelower}";
+ if ($timeupper)
+ $where[] = "a.time_created <= {$timeupper}";
if ($count) {
$query = "SELECT count(distinct e.guid) as total ";
|