36 $this->cache = $cache;
55 if ($case_sensitive) {
56 return $this->getIdCaseSensitive(
$string);
58 return $this->getIdCaseInsensitive(
$string);
70 private function getIdCaseSensitive(
$string) {
73 $escaped_string = $this->db->sanitizeString(
$string);
74 $query =
"SELECT * FROM {$this->getTableName()} WHERE string = BINARY '$escaped_string' LIMIT 1";
75 $results = $this->db->getData($query);
76 if (isset($results[0])) {
77 return $results[0]->id;
92 private function getIdCaseInsensitive(
$string) {
95 $escaped_string = $this->db->sanitizeString(
$string);
96 $query =
"SELECT * FROM {$this->getTableName()} WHERE string = '$escaped_string'";
97 $results = $this->db->getData($query);
100 $ids[] = $result->id;
117 $escaped_string = $this->db->sanitizeString(trim(
$string));
119 return $this->db->insertData(
"INSERT INTO {$this->getTableName()} (string) VALUES ('$escaped_string')");
128 return $this->db->getTablePrefix() .
"metastrings";