}
$options['wheres'] = array_merge($options['wheres'], $clauses['wheres']);
-
+
// merge joins to pass to get_entities()
if (isset($options['joins']) && !is_array($options['joins'])) {
$options['joins'] = array($options['joins']);
if (is_array($pairs)) {
// join counter for incremental joins in pairs
$i = 1;
-
+
// check if this is an array of pairs or just a single pair.
if (isset($pairs['name']) || isset($pairs['value'])) {
$pairs = array($pairs);
if ($where) {
$return['wheres'][] = "($where)";
}
-
+
return $return;
}
$name = sanitise_string($name);
$value = sanitise_string($value);
+ $entity = get_entity($entity_guid);
+ if (!$entity instanceof ElggEntity) {
+ return false;
+ }
+
$result = insert_data("INSERT into {$CONFIG->dbprefix}private_settings
(entity_guid, name, value) VALUES
($entity_guid, '{$name}', '{$value}')