Get sorting order of name, stripping possible "DESC", "ASC", and also
return the sorting order.

@param string $name

@return array
170609
private function getSortOrder($name = '-datepublish')
    {
        $parts = explode(' ', $name);
        $fieldName = $parts[0];
        $sort = 'ASC';
        if (isset($parts[1])) {
            $sort = $parts[1];
        }

        if ($fieldName[0] === '-') {
            $fieldName = substr($fieldName, 1);
            $sort = 'DESC';
        }

        return [$fieldName, (strtoupper($sort) === 'ASC')];
    }
320513
public static function getISOByName($name)
    {
        $data = collect(self::ISOlist());
        return $data->where('name', $name)->first();
    }
283105
public function findHeaders($name)
    {
        return array_filter($this->getHeaders(), function ($header) use ($name) {
            return StringType::startsWith($header, "$name:");
        });
    }
1260923
public function getValues($name)
    {
        $return = [];
        $items  = $this->getItems();

        foreach ($items as $type) {
            $method = 'get' . ucfirst($name);
            if (method_exists($type, $method)) {
                $return[] = $type->$method();
            } else {
                $return[] = $type->{$name};
            }
        }

        return $return;
    }
936678
protected function get(string $name)
    {
        $name[0] = strtolower($name[0]);

        return $this->list[$name] ?? null;
    }
313617
public function getSort($sortName): ?OrderBy
    {
        [$name, $sorts] = $this->getArrayAndKeyName($sortName, 'sorts');

        return array_first($sorts, function ($sort) use ($name) {
            return $sort->getName() === $name;
        });
    }
714027
public static function get($name)
    {
        if (isset($_REQUEST[$name])) {
            return $_REQUEST[$name];
        }

        if (isset($_GET[$name])) {
            return $_GET[$name];
        }

        return;
    }
559403
public function getDescription($name)
    {
        if (!$this->isParsed) {
            $this->parseDefinitions();
        } //if

        $longName = (strlen($name) == 1 ? ( isset($this->shortNames[$name]) ? $this->shortNames[$name] : '') : $name);

        if (isset($this->longNames[$longName])) {
            return $this->longNames[$longName]['description'];
        } else {
            return null;
        } //if
    }
1130706
public function getLongName($name)
    {
        if (!$this->isParsed) {
            $this->parseDefinitions();
        } //if

        if (isset($this->shortNames[$name])) {
            return $this->shortNames[$name];
        } else {
            return null;
        } //if
    }
1258037
protected function parseAlias($name)
    {
        if (strpos($name, ' ') !== false && preg_match('/^\s*(.+)(\s+as\s+)(.+)\s*$/i', $name, $matches)) {
            return array($matches[1], $matches[3]);
        }

        return array($name, null);
    }
1167466
public function get($name)
    {
        $name = $this->normalizeName($name);
        $data = [];
        if (isset($this->data[$name])) {
            $data = $this->data[$name];
        }

        return $data;
    }
325808
public static function getConstantByName($name)
    {
        switch (strtolower($name)) {
            case 'single':
                return self::SINGLE;
            break;

            case 'multiple':
                return self::MULTIPLE;
            break;

            case 'ordered':
                return self::ORDERED;
            break;

            case 'record':
                return self::RECORD;
            break;

            default:
                return false;
            break;
        }
    }
319513
public function get($name)
	{
		$namespaced = $this->namespace.':'.$name;

		$queued   = $this->length($namespaced, 'list');
		$delayed  = $this->length($namespaced.':delayed', 'zset');
		$reserved = $this->length($namespaced.':reserved', 'zset');

		return array('queued' => $queued, 'delayed' => $delayed, 'reserved' => $reserved);
	}
500733
private function getClosure($name) {
        return isset($this->bindings[$name]) ? $this->bindings[$name]['closure'] : $name;
    }
314448
public static function getSortedSet(string $name): array
    {
        $obj = new RedisSortedSet(self::handle(), $name);
        return $obj->all();
    }
129430
public final function getHeader($name): array
   {
       $key = $this->parseHeaderName($name);
       return array_key_exists($key, $this->header) ? $this->header[$key] : [];
   }
395430
public function parseTable($name): array
    {
        if ($name instanceof Model) {
            return [$name->alias(), $name->name()];
        }

        if (is_array($name)) {
            return [key($name), current($name)];
        }

        if (is_scalar($name)) {
            return static::parseName($name);
        }

        return [null, $name];
    }