aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-11 14:37:42 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-11 14:37:42 +0000
commitf251e2040785a7b2f1ee51927d98af217546fc8d (patch)
tree068aebfce926fdd42f089058ee2880dc5bd30a49 /engine/lib/metadata.php
parentb5d489b4ce30472f974fdb794cfea77a624c7bee (diff)
downloadelgg-f251e2040785a7b2f1ee51927d98af217546fc8d.tar.gz
elgg-f251e2040785a7b2f1ee51927d98af217546fc8d.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Value type added git-svn-id: https://code.elgg.org/elgg/trunk@163 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 105001535..3659a7075 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -248,7 +248,7 @@
* @param int $offset
* @return array of ElggMetadata
*/
- function get_metadatas($object_id = 0, $object_type = "", $name = "", $value = "", $owner_id = 0, $order_by = "created desc", $limit = 10, $offset = 0)
+ function get_metadatas($object_id = 0, $object_type = "", $name = "", $value = "", $value_type = "", $owner_id = 0, $order_by = "created desc", $limit = 10, $offset = 0)
{
global $CONFIG;
@@ -256,6 +256,7 @@
$object_type = sanitise_string(trim($object_type));
$name = sanitise_string(trim($name));
$value = sanitise_string(trim($value));
+ $value_type = sanitise_string(trim($value_type));
$owner_id = (int)$owner_id;
@@ -280,6 +281,9 @@
if ($value != "")
$where[] = "value='$value'";
+ if ($value_type != "")
+ $where[] = "value_type='$value_type'";
+
// add access controls
$access = get_access_list();
$where[] = "(access_id in {$access} or (access_id = 0 and owner_id = {$_SESSION['id']}))";
@@ -306,9 +310,9 @@
* @param int $offset
* @return mixed Array of objects or false.
*/
- function get_objects_from_metadatas($object_id = 0, $object_type = "", $name = "", $value = "", $owner_id = 0, $order_by = "created desc", $limit = 10, $offset = 0)
+ function get_objects_from_metadatas($object_id = 0, $object_type = "", $name = "", $value = "", $value_type = "", $owner_id = 0, $order_by = "created desc", $limit = 10, $offset = 0)
{
- $results = get_metadatas($object_id, $object_type, $name, $value, $owner_id, $order_by, $limit, $offset);
+ $results = get_metadatas($object_id, $object_type, $name, $value, $value_type, $owner_id, $order_by, $limit, $offset);
$objects = false;
if ($results)