<?php
namespace Modules\Orders\Galileo\Collector\Model\Filters; class FileParsed extends \ModulesAbstract\ImportedOrdersFileManager\Model\Filters\FileParsedAbstract { protected function getFilesFromDatabase($basePath) { global $DBTGalileoParsedFiles; $layoutHandlerSettings = $this->layoutHandler->getSettings(); if ($basePath == '/') { $basePath = ''; } if ($layoutHandlerSettings['recurse']) { $sql = sprintf("SELECT `filePath` FROM `{$DBTGalileoParsedFiles}` WHERE `filePath` LIKE '%s%%'", $this->sqlEscapeForRegexpString($basePath)); } else { $sql = sprintf("SELECT `filePath` FROM `{$DBTGalileoParsedFiles}` WHERE `filePath` REGEXP '^%s[^\/]+$'", $this->sqlEscapeForRegexpString($basePath)); } $db = \DB::getInstance(); $galileoFiles = $db->GetCol($sql); if ($db->ErrorNo()) { throw new \DBException("Cannot get Galileo parsed files from database"); } return $galileoFiles; } }