Lines Matching refs:key

97      * @return array    $sort_array     array of array(one value for each key to be sorted)
173 foreach (array_keys($col_keys) as $key) {
175 switch ($key) {
179 $value = $this->first($abc, strlen($key));
184 // save a few microseconds by just moving on to the next key
216 $dtype = $key[0];
226 // only set date formats once per sort column/key (not per id!), i.e. on first row
228 $dformat[$key] = $this->dateFormat($key);
230 $wformat[$key] = ($opt['spelldate']) ? $this->dateFormatWords($dformat[$key]) : '';
234 $value = strftime($dformat[$key], $real_date);
238 $row[$key] = $value;
250 $key = $match[1];
252 if (isset($row[$key])) {
253 $value = $row[$key];
254 } elseif (isset($meta[$key])) {
255 $value = $meta[$key];
257 } elseif (strpos($key, ':') !== false) {
258 $keys = explode(':', $key);
262 } elseif ($key === 'mdate') {
264 } elseif ($key === 'cdate') {
268 if (strpos($key, 'date') !== false && $value != '') {
289 foreach ($opt['sort'] as $key => $value) {
290 $sort_opts['key'][] = $key;
303 switch ($key) {
324 switch ($key) {
341 switch ($key) {
357 $group_opts['key'][$idx] = $key;
359 $group_opts['dformat'][$idx] = $wformat[$key];
376 foreach ($arr as $key => $value) {
378 $result .= $key . $delim;
391 * @param string $key
393 private function dateFormat(string $key): string
396 if (strpos($key, 'year') !== false) {
399 if (strpos($key, 'month') !== false) {
402 if (strpos($key, 'day') !== false) {
545 * @param array $filter meta-data filter: <meta key>:<query>
550 // allow for exclusion matches (put ^ or ! in front of meta key)
608 * $sort_opts['key'][<column>] = 'key'
628 $keys = $sort_opts['key'];
639 foreach ($keys as $idx => $key) {
643 $key_cmp = (((int)$left[$key] === (int)$right[$key]) ?
644 0 : (((int)$left[$key] < (int)$right[$key]) ? -1 : 1));
648 $key_cmp = strcmp((string)$left[$key], (string)$right[$key]);
652 $key_cmp = strcasecmp((string)$left[$key], (string)$right[$key]);
656 $key_cmp = strnatcmp((string)$left[$key], (string)$right[$key]);
660 $key_cmp = strnatcasecmp((string)$left[$key], (string)$right[$key]);
665 $key_cmp = (($left[$key] == $right[$key]) ?
666 0 : (($left[$key] < $right[$key]) ? -1 : 1));
692 * $group_opts['key'][<order>] = column key to group by
710 foreach ($keys as $key) {
711 $result[] = $row[$key];
716 $level = count($group_opts['key']) - 1;
744 $key = $group_opts['key'][$level];
745 $cur = $sort_array[$idx][$key];