Parse the key into field and operator.

@param string $key
@return array
434996
protected function parse(string $key): array
    {
        if (strpos($key, '(') === false && strpos($key, ')') === false) {
            return ['field' => trim($key), 'operator' => ''];
        }

        if (!preg_match(static::REGEXP, $key, $matches)) {
            throw new InvalidFilterException("Invalid filter item '$key': Bad use of parentheses");
        }

        return array_only($matches, ['field', 'operator']) + ['operator' => ''];
    }
310396
private function parseKeys($keys)
    {
        if (is_string($keys)) {
            if (strpos($keys, '[') !== false) {
                $keys = str_replace(']', '', $keys);
                $keys = explode('[', trim($keys, '['));
            } else {
                $keys = (array) $keys;
            }
        }

        return $keys;
    }
722031
public function fieldsByKey($key)
	{
		$keys = array();

		if ($this->rows && $this->count())
		{
			foreach ($this->rows as $row)
			{
				$keys[] = $row->$key;
			}
		}

		return $keys;
	}
330517
public function extractKey($key)
    {
        $self       = clone($this);
        $self->data = Accessor::get($this->data, $key) ?: [];
        return $self;
    }
182385
private function parseKey($key)
    {
        if (is_object($key) and $key instanceof AccessKey) {
            return $key;
        }

        $key = AccessKey::create($key);

        return $key;
    }
942760
public function getStorageField($key)
    {
        $pos = strpos($key, $this->keySeparator);

        if ($pos) {
            return substr($key, 0, $pos);
        }

        return null;
    }
527344
protected function processKey($key)
    {
        $key = trim(strtolower($key));
        $key = preg_replace('#[^a-z0-9\.]#', '-', $key) . '~' . $this->keySuffix;

        return $key;
    }
1205310
protected function parseKey($key)
    {
        if (!isset($this->keys[$key])) {
            $this->keys[$key] = explode($this->separator, $key);
        }

        return $this->keys[$key];
    }
725540
public function getAsArray($key)
    {
        if (! $this->has($key)) {
            return [];
        }
        $res = $this->attributes[$key];
        if (is_null($res)) {
            return [null];
        }

        return (array) $res;
    }
549351
protected function parseKey($key)
    {
        if (0 === strpos($key, '__TABLE__.')) {
            list($collection, $key) = explode('.', $key, 2);
        }

        if ('id' == $key && $this->connection->getConfig('pk_convert_id')) {
            $key = '_id';
        }

        return trim($key);
    }
752032
protected function _normalizeKey($key)
    {
        try {
            return $this->_normalizeString($key);
        } catch (InvalidArgumentException $e) {
            throw $this->_createOutOfRangeException($this->__('Invalid key'), null, $e, $key);
        }
    }
1075976
protected function parseKey($key)
    {
        if (0 === strpos($key, '__TABLE__.')) {
            $tmp = explode('.', $key, 2);
            $key = isset($tmp[1]) ? $tmp[1] : null;
        }
        if ('id' == $key && $this->connection->getConfig('pk_convert_id')) {
            $key = '_id';
        }
        return trim($key);
    }
94254
protected function parseSubkeys($key) {
        $k          = $key;
        $subkeys    = [];
        $quoteChars = ["'", '"'];                       // single and double quotes

        while (true) {
            $k = trim($k);

            foreach ($quoteChars as $char) {
                if (strpos($k, $char) === 0) {          // subkey starts with a quote char
                    $pos = strpos($k, $char, 1);        // find the ending quote char
                    if ($pos === false) throw new InvalidArgumentException('Invalid argument $key: '.$key);
                    $subkeys[] = substr($k, 1, $pos-1);
                    $k         = trim(substr($k, $pos+1));
                    if (!strlen($k))                    // last subkey or next char is a key separator
                        break 2;
                    if (strpos($k, '.') !== 0) throw new InvalidArgumentException('Invalid argument $key: '.$key);
                    $k = substr($k, 1);
                    continue 2;
                }
            }

            // key is not quoted
            $pos = strpos($k, '.');                     // find next key separator
            if ($pos === false) {
                $subkeys[] = $k;                        // last subkey
                break;
            }
            $subkeys[] = trim(substr($k, 0, $pos));
            $k         = substr($k, $pos+1);            // next subkey
        }
        return $subkeys;
    }
1328887
public function get($key)
    {
        $data = $this->connection()->get($this->prefix.$key);

        if (!is_null($data)) {
            return (is_numeric($data)) ? $data : unserialize($data);
        }
    }
116209
public function toArrayByKey($key)
    {
        $data = [];
        if (isset($this->id)) {
            $data['id[' . $key . ']'] = $this->getId();
        }
        if (isset($this->pr)) {
            $data['pr[' . $key . ']'] = $this->getPr();
        }
        if (isset($this->no)) {
            $data['no[' . $key . ']'] = $this->getNo();
        }
        if (isset($this->de)) {
            $data['de[' . $key . ']'] = $this->getDe();
        }
        if (isset($this->it)) {
            $data['it[' . $key . ']'] = $this->getIt();
        }
        if (isset($this->va)) {
            $data['va[' . $key . ']'] = $this->getVa();
        }
        if (isset($this->sd)) {
            $data['sd[' . $key . ']'] = $this->getSd();
        }
        if (isset($this->ed)) {
            $data['ed[' . $key . ']'] = $this->getEd();
        }

        return $data;
    }
966307
final protected function getArrayValue(string $key): array
    {
        $value = $this->getConfigValue($key);
        if (!$value || !\is_array($value)) {
            return [];
        }

        return $value;
    }
993950
public function getFieldValues($key)
    {
        $values = array();
        $key = strtolower($key);

        foreach ($this->fields as $part => $value) {
            if (strtolower($part) === $key) {
                if (is_array($value)) {
                    foreach ($value as $v) {
                        $values []= $v;
                    }
                } else {
                    $values []= $value;
                }
            }
        }

        return $values;
    }