Contao\Theme::addTableTlFiles PHP Method

addTableTlFiles() protected method

Add the table tl_files to the XML and the files to the archive
protected addTableTlFiles ( DOMDocument $xml, DOMElement $tables, Result $objTheme, ZipWriter $objArchive )
$xml DOMDocument
$tables DOMElement
$objTheme Contao\Database\Result
$objArchive ZipWriter
    protected function addTableTlFiles(\DOMDocument $xml, \DOMElement $tables, Database\Result $objTheme, ZipWriter $objArchive)
    {
        // Add the table
        $table = $xml->createElement('table');
        $table->setAttribute('name', 'tl_files');
        $table = $tables->appendChild($table);
        // Load the DCA
        $this->loadDataContainer('tl_files');
        // Get the order fields
        $objDcaExtractor = \DcaExtractor::getInstance('tl_files');
        $arrOrder = $objDcaExtractor->getOrderFields();
        // Add the folders
        $arrFolders = \StringUtil::deserialize($objTheme->folders);
        if (!empty($arrFolders) && is_array($arrFolders)) {
            $objFolders = \FilesModel::findMultipleByUuids($arrFolders);
            if ($objFolders !== null) {
                foreach ($this->eliminateNestedPaths($objFolders->fetchEach('path')) as $strFolder) {
                    $this->addFolderToArchive($objArchive, $strFolder, $xml, $table, $arrOrder);
                }
            }
        }
    }