public static findMultipleByPaths ( array $arrPaths, array $arrOptions = [] ) : |
||
$arrPaths | array | An array of file paths |
$arrOptions | array | An optional options array |
return | 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);
}