public function getAll($classname, $filter = null, AbstractModel $parent = null)
    {
        $filterUrl = '';
        if (!is_null($filter)) {
            if (
                isset($this->filters[$classname]) &&
                in_array($filter, $this->filters[$classname])) {

                $filterUrl = '/filter/' . $filter;
            } elseif (
                isset($this->filters[$classname]) &&
                preg_match('/^[0-9]+$/D', $filter)) {

                $filterUrl = '/filter/' . $filter;
            } else {
                $message = 'Unknown filter "' . $filter . '" for ' . $classname;
                if (isset($this->filters[$classname])) {
                    $message .= '; available filters: ' . implode(', ', $this->filters[$classname]);
                }
                throw new InvalidFilterException($message);
            }
        }

        $response = $this->request($this->buildUrl(new $classname(), $parent, $filterUrl), 'GET');
        return $this->mapper->mapFromStorage($response);
    }