/**
* Sets a private setting for an entity.
*
* @param int $entity_guid The entity GUID
* @param string $name The name of the setting
* @param string $value The value of the setting
* @return bool
*/
public function set($entity_guid, $name, $value)
{
$this->cache->clear($entity_guid);
_elgg_services()->boot->invalidateCache();
if (!$this->entities->exists($entity_guid)) {
return false;
}
$query = "\n\t\t\tINSERT into {$this->table}\n\t\t\t(entity_guid, name, value) VALUES\n\t\t\t(:entity_guid, :name, :value)\n\t\t\tON DUPLICATE KEY UPDATE value = :value\n\t\t";
$params = [':entity_guid' => (int) $entity_guid, ':name' => (string) $name, ':value' => (string) $value];
$result = $this->db->insertData($query, $params);
return $result !== false;
}