Lines Matching defs:key

157      * An empty value will erase the key.
158 * The $key parameter can be an array to add multiple keys. $value will
159 * not be used if $key is an array.
162 * @param mixed $key a key string or array of key=>value pairs
169 public function addMetaKeys($page, $key, $value = null)
171 if (!is_array($key)) {
172 $key = [$key => $value];
174 // $key is array, but $value is not null
189 if (isset($key['title'])) {
190 $value = $key['title'];
195 unset($key['title']);
198 foreach ($key as $name => $values) {
315 * @param string $key The metadata key of which a value shall be changed
320 public function renameMetaValue($key, $oldvalue, $newvalue)
325 $metavalues = $this->getIndex($key, '_w');
334 $indexline = $this->getIndexKey($key . '_i', '', $oldid);
336 $newindexline = $this->getIndexKey($key . '_i', '', $newid);
337 $pagekeys = $this->getIndex($key . '_p', '');
352 $this->saveIndex($key . '_p', '', $pagekeys);
354 $this->saveIndexKey($key . '_i', '', $oldid, '');
355 $this->saveIndexKey($key . '_i', '', $newid, $newindexline);
359 if (!$this->saveIndex($key . '_w', '', $metavalues)) {
604 * The returned array will have the original tokens as key. The values
652 * Find pages containing a metadata key.
661 * @param string $key name of the metadata key to look for
669 public function lookupKey($key, &$value, $func = null)
678 $metaname = idx_cleanName($key);
681 if ($key == 'title') {
729 if ($key == 'title') {
844 * @param string $key list only pages containing the metadata key (optional)
849 public function getPages($key = null)
852 if (is_null($key)) return $page_idx;
854 $metaname = idx_cleanName($key);
857 if ($key == 'title') {
879 * @param string $key metadata key to list. Uses the fulltext index if not given
884 public function histogram($min = 1, $max = 0, $minlen = 3, $key = null)
893 if ($key == 'title') {
900 } elseif (!is_null($key)) {
901 $metaname = idx_cleanName($key);
1159 foreach (array_keys($filter) as $key) {
1160 if (file_exists($path . $key . '.idx'))
1161 $idx[] = $key;
1217 [$key, $cnt] = explode('*', $tuple);
1219 if (isset($keys[$key])) {
1220 $key = $keys[$key];
1221 if ($key === false || is_null($key)) continue;
1223 $result[$key] = $cnt;