Jarves\Storage\FileStorage::primaryStringToArray PHP Метод

primaryStringToArray() публичный Метод

Same as parent method, except: If we get the PK as path we convert it to internal ID.
public primaryStringToArray ( $primaryKey )
    public function primaryStringToArray($primaryKey)
    {
        if (is_array($primaryKey)) {
            return $primaryKey;
        }
        if ($primaryKey === '') {
            return false;
        }
        $groups = explode('/', $primaryKey);
        $result = array();
        foreach ($groups as $group) {
            $item = array();
            if ('' === $group) {
                continue;
            }
            $primaryGroups = explode(',', $group);
            foreach ($primaryGroups as $pos => $value) {
                if ($ePos = strpos($value, '=')) {
                    $key = substr($value, 0, $ePos);
                    $value = substr($value, $ePos + 1);
                    if (!in_array($key, $this->primaryKeys)) {
                        continue;
                    }
                } elseif (!$this->primaryKeys[$pos]) {
                    continue;
                }
                if (is_numeric($value)) {
                    $value = $this->webFilesystem->getPath($value);
                } else {
                    $value = Tools::urlDecode($value);
                }
                $item['path'] = $value;
            }
            if (count($item) > 0) {
                $result[] = $item;
            }
        }
        return $result;
    }