Contao\DC_Table::showAll PHP Method

showAll() public method

List all records of a particular table
public showAll ( ) : string
return string
    public function showAll()
    {
        $return = '';
        $this->limit = '';
        $this->bid = 'tl_buttons';
        /** @var SessionInterface $objSession */
        $objSession = \System::getContainer()->get('session');
        // Clean up old tl_undo and tl_log entries
        if ($this->strTable == 'tl_undo' && strlen(\Config::get('undoPeriod'))) {
            $this->Database->prepare("DELETE FROM tl_undo WHERE tstamp<?")->execute(intval(time() - \Config::get('undoPeriod')));
        } elseif ($this->strTable == 'tl_log' && strlen(\Config::get('logPeriod'))) {
            $this->Database->prepare("DELETE FROM tl_log WHERE tstamp<?")->execute(intval(time() - \Config::get('logPeriod')));
        }
        $this->reviseTable();
        // Add to clipboard
        if (\Input::get('act') == 'paste') {
            $arrClipboard = $objSession->get('CLIPBOARD');
            $arrClipboard[$this->strTable] = array('id' => \Input::get('id'), 'childs' => \Input::get('childs'), 'mode' => \Input::get('mode'));
            $objSession->set('CLIPBOARD', $arrClipboard);
        }
        // Custom filter
        if (!empty($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['filter']) && is_array($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['filter'])) {
            foreach ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['filter'] as $filter) {
                $this->procedure[] = $filter[0];
                $this->values[] = $filter[1];
            }
        }
        // Render view
        if ($this->treeView) {
            $return .= $this->panel();
            $return .= $this->treeView();
        } else {
            if (\Input::get('table') && $this->ptable && $this->Database->fieldExists('pid', $this->strTable)) {
                $this->procedure[] = 'pid=?';
                $this->values[] = CURRENT_ID;
            }
            $return .= $this->panel();
            $return .= $GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] == 4 ? $this->parentView() : $this->listView();
            // Add another panel at the end of the page
            if (strpos($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['panelLayout'], 'limit') !== false) {
                $return .= $this->paginationMenu();
            }
        }
        // Store the current IDs
        $session = $objSession->all();
        $session['CURRENT']['IDS'] = $this->current;
        $objSession->replace($session);
        return $return;
    }