@param bool $prefix

@return array
190873
public function getFormatsDate($prefix = true)
    {
        $formats = $this->formatsDate;
        // Add other common suggestions
        foreach ($this->formatInterval as $key => $value) {
            foreach (['hours', 'minutes', 'seconds'] as $exclusion) {
                if ($key == $exclusion) {
                    continue;
                }
            }
            foreach (['till', 'since'] as $op) {
                if ('age' == $key) {
                    $op = '';
                }
                $formats[$key.$op] = $value;
            }
        }

        return $this->prefixWithHelperName($formats, $prefix);
    }
301311
private function getFiltered(bool $public = true): array
    {
        $result = [];
        foreach ($this->events as $event) {
            if ($event['is_public'] === $public) {
                $result[] = $event;
            }
        }
        return $result;
    }
1064089
public static function getStaticEnumTypes($prefix)
    {
        $s_prefix = 'static_'.$prefix;
        if (!isset(static::$ENUMS[$s_prefix]) || !is_array(static::$ENUMS[$s_prefix]) || !static::$ENUMS[$s_prefix]) {
            static::$ENUMS[$s_prefix] = array();
            $ref = new ReflectionClass(get_called_class());
            foreach ($ref->getStaticProperties() as $k => $d) {
                $matches = array();
                if (is_string($k) && preg_match('/^'.preg_quote($prefix).'_(.*)/', $k, $matches)) {
                    static::$ENUMS[$s_prefix][$matches['1']] = $d;
                }
            }
        }

        return static::$ENUMS[$s_prefix];
    }
37061
public function getClassNamespace(bool $prefix = false): string
	{
		if($this->classNamespace === null)
		{
			$this->classNamespace = substr(static::class, 0, strrpos(static::class, '\\'));
		}

		return $prefix ? '\\' . $this->classNamespace : $this->classNamespace;
	}
306604
public function getLocalesFiles($prefix = '')
    {
        $files = [];
        foreach ($this->getDirectories() as $directory) {
            $directory = rtrim($directory, '\\/');
            foreach (glob("$directory/$prefix*.php") as $file) {
                $files[] = $file;
            }
        }

        return array_unique($files);
    }
445819
public function getFullUrl($prefix = TRUE)
    {
        if ($this->_fullUrl === FALSE) $this->fillPath();
		
        if ($prefix) {
			if (
				(!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ||
				(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || 
				(!empty($_SERVER['HTTP_HTTPS']) && $_SERVER['HTTP_HTTPS'] !== 'off') || 
				(!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)
			)		
				$schema = 'https:/';
				else $schema = 'http:/';
			return $schema.$this->_fullUrl;
		}
        return $this->_fullUrl;
    }
1123500
protected function getUserActions(string $prefix, array $except = []): array
    {
        $actions = [];

        if (!in_array('_search', $except)) {
            $actions[] = 'search';
        }

        if (!in_array('_create', $except) && auth()->user()->can($prefix . '_create')) {
            $actions[] = 'new';
        }

        if (!in_array('_update', $except) && auth()->user()->can($prefix . '_update')) {
            $actions[] = 'update';
        }

        if (!in_array('_delete', $except) && auth()->user()->can($prefix . '_delete')) {
            $actions[] = 'delete';
        }

        if (!in_array('_restore', $except) && auth()->user()->can($prefix . '_restore')) {
            $actions[] = 'restore';
        }

        if (!in_array('_force_delete', $except) && auth()->user()->can($prefix . '_force_delete')) {
            $actions[] = 'forceDelete';
        }

        if (!in_array('_merge', $except) && auth()->user()->can($prefix . '_merge')) {
            $actions[] = 'merge';
        }

        if (!in_array('_clone', $except) && auth()->user()->can($prefix . '_clone')) {
            $actions[] = 'clone';
        }

        return $actions;
    }
634895
public static function addEachKey(array $array, $prefix): array
    {
        $result = [];

        foreach ($array as $key => $item) {
            $result[$prefix . $key] = $item;
        }

        return $result;
    }
754788
public function getFormatsTime($prefix = true)
    {
        $formats = $this->formatsTime;
        // Add other common suggestions
        foreach ($this->formatInterval as $key => $value) {
            foreach (['months', 'years', 'days', 'age'] as $exclusion) {
                if ($key == $exclusion) {
                    continue;
                }
            }
            foreach (['from', 'till'] as $op) {
                $formats[$key.$op] = $value;
            }
        }

        return $this->prefixWithHelperName($formats, $prefix);
    }
225872
private function getAuthParams($prefix)
    {
        return array_intersect_key($this->params, array_flip($this->addPrefix($this->auth, $prefix)));
    }
176962
public function nestArray($prefix, $array)
    {
        $data = [];
        foreach($array as $key => $value) {
            array_set($data, $prefix.$key, $value);
        }
        return $data;
    }
207582
protected function course_students_query_filter($prefix = false) {
        global $DB;

        if ($prefix) {
            $prefix = $prefix . '.';
        }

        // Check the amount of student logs in the 4 previous weeks.
        list($studentssql, $studentsparams) = $DB->get_in_or_equal($this->get_students(), SQL_PARAMS_NAMED);
        $filterselect = $prefix . 'courseid = :courseid AND ' . $prefix . 'userid ' . $studentssql;
        $filterparams = array('courseid' => $this->course->id) + $studentsparams;

        return array($filterselect, $filterparams);
    }
799000
public static function getAllArrayItemsByKeyPrefix($array, $prefix, $stripPrefix = false) {
        $returnValues = array();
        foreach ($array as $key => $value) {
            $positionOfPrefix = strpos($key, $prefix);
            if (is_numeric($positionOfPrefix) && $positionOfPrefix == 0) {
                if ($stripPrefix) $key = substr($key, strlen($prefix));
                $returnValues [$key] = $value;
            }
        }

        return $returnValues;
    }
782446
private function prefix($prefix)
    {
        if ($prefix) {
            $prefixLastChar = substr($prefix, -1);

            if ($prefixLastChar != '.' && $prefixLastChar != ':') {
                $prefix .= '.';
            }
        }

        return $prefix;
    }
645596
public function prefix($prefix) {
		// Reset values before matching.
		$this->prefix = $this->parentPrefix;
		$this->requestPathOffset = $this->parentRequestPathOffset;
		if ($this->parentPrefixMatched) {
			$this->prefixMatched = $this->parentPrefixMatched;
		}

		if (!$this->result->hasHandler() && $this->prefixMatched) {
			$this->prefixMatched = $this->matchPartial($prefix);
		}

		$this->prefix .= $prefix;

		return $this;
	}
252077
public function get(string $prefix, bool $fuzzy = false, bool $withPayloads = false, int $max = -1): array
    {
        $args = [
            $this->indexName,
            $prefix,
        ];
        if ($fuzzy) {
            $args[] = 'FUZZY';
        }
        if ($withPayloads) {
            $args[] = 'WITHPAYLOADS';
        }
        if ($max >= 0) {
            $args[] = 'MAX';
            $args[] = $max;
        }
        return $this->redisClient->rawCommand('FT.SUGGET', $args);
    }
730314
private function getCompletionsForKeywords(string $prefix): \Generator
    {
        foreach (self::KEYWORDS as $keyword) {
            if (nameStartsWith($keyword, $prefix)) {
                $item = new CompletionItem($keyword, CompletionItemKind::KEYWORD);
                $item->insertText = $keyword;
                yield $keyword => $item;
            }
        }
    }