public function fetchAll($params = array()) { $this->params = BatchValidator::combine($params, $this->params); if ($this->isFiltered()) { $results = $this->gateway->read($this->collectionUrl(), $this->params); } elseif ($this->getLast) { $results = $this->collection->fetchLastInCollection($this->gateway, $this->collectionUrl(), $this->params); $this->getLast = false; } elseif ($this->getIncrement) { $results = $this->collection->fetchIncrement($this->gateway, $this->collectionUrl(), $this->params); $this->getIncrement = false; } else { $results = $this->collection->fetchCollection($this->gateway, $this->collectionUrl(), $this->params); } return $results; }