Contao\FilesModel::findMultipleByPaths PHP Method

findMultipleByPaths() public static method

Find multiple files by their paths
public static findMultipleByPaths ( array $arrPaths, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null
$arrPaths array An array of file paths
$arrOptions array An optional options array
return Contao\Model\Collection | FilesModel[] | FilesModel | null A collection of models or null if there are no files
    public static function findMultipleByPaths($arrPaths, array $arrOptions = array())
    {
        if (!is_array($arrPaths) || empty($arrPaths)) {
            return null;
        }
        $t = static::$strTable;
        if (!isset($arrOptions['order'])) {
            $arrOptions['order'] = \Database::getInstance()->findInSet("{$t}.path", $arrPaths);
        }
        return static::findBy(array("{$t}.path IN(" . implode(',', array_fill(0, count($arrPaths), '?')) . ")"), $arrPaths, $arrOptions);
    }