57 if ($case_sensitive) {
58 return $this->getIdCaseSensitive(
$string);
60 return $this->getIdCaseInsensitive(
$string);
73 function getMap(array $string_keys) {
77 if (count($string_keys) === 1) {
78 $key = reset($string_keys);
79 return [
$key => $this->getIdCaseSensitive(
$key)];
82 $missing = array_fill_keys($string_keys,
true);
84 $set_element = array_map(
function (
$string) {
85 return "BINARY '" . $this->db->sanitizeString(
$string) .
"'";
88 $set = implode(
',', $set_element);
90 $query =
"SELECT * FROM {$this->getTableName()} WHERE string IN ($set)";
93 foreach ($this->db->getData($query) as
$row) {
95 unset($missing[
$row->string]);
97 foreach (array_keys($missing) as
$string) {
112 private function getIdCaseSensitive(
$string) {
124 $query =
"SELECT id FROM {$this->getTableName()} WHERE string = BINARY :string";
150 private function getIdCaseInsensitive(
$string) {
153 $query =
"SELECT id FROM {$this->getTableName()} WHERE string = :string";
157 $results = $this->db->getData($query, null,
$params);
159 foreach ($results as
$result) {
160 $ids[] = $result->id;
177 $sql =
"INSERT INTO {$this->getTableName()} (string) VALUES (:string)";
179 ':string' => trim((
string)
$string),
181 return $this->db->insertData($sql,
$params);
190 return $this->db->prefix .
"metastrings";
_elgg_get_memcache($namespace= 'default')
Get a namespaced ElggMemcache object (if memcache is available) or a null cache.
if(!$collection_name) $id
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use