MetaModels\DcGeneral\Data\Driver::fetchAll PHP Метод

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

Fetch all records (optional filtered, sorted and limited).
public fetchAll ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
$objConfig ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface The configuration to be applied.
Результат ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
    public function fetchAll(ConfigInterface $objConfig)
    {
        $backupLanguage = $this->setLanguage($this->getCurrentLanguage());
        $filter = $this->prepareFilter($objConfig);
        if ($objConfig->getIdOnly()) {
            $this->setLanguage($backupLanguage);
            return $this->getIdsFromFilter($filter, $objConfig);
        }
        $items = $this->getItemsFromFilter($filter, $objConfig);
        $collection = $this->getEmptyCollection();
        foreach ($items as $objItem) {
            $collection->push(new Model($objItem));
        }
        $this->setLanguage($backupLanguage);
        return $collection;
    }