Contao\FilesModel::findByUuid PHP Method

findByUuid() public static method

Find a file by its UUID
public static findByUuid ( string $strUuid, array $arrOptions = [] ) : FilesModel | null
$strUuid string The UUID string
$arrOptions array An optional options array
return FilesModel | null The model or null if there is no file
    public static function findByUuid($strUuid, array $arrOptions = array())
    {
        $t = static::$strTable;
        // Convert UUIDs to binary
        if (\Validator::isStringUuid($strUuid)) {
            $strUuid = \StringUtil::uuidToBin($strUuid);
        }
        return static::findOneBy(array("{$t}.uuid=UNHEX(?)"), bin2hex($strUuid), $arrOptions);
    }

Usage Example

Ejemplo n.º 1
0
 public function addTypeIcon($row, $label, DataContainer $dc, $args = null)
 {
     $args[0] = \Image::getHtml(\Image::get('system/modules/mail_to/assets/mail-open-image.png', 16, 16));
     $objFile = FilesModel::findByUuid($row['folder']);
     $args[2] = $objFile !== null ? $objFile->path : '-';
     $args[5] = Date::parse(Date::getFormatFromRgxp('datim'), $row['lastrun']);
     return $args;
 }
All Usage Examples Of Contao\FilesModel::findByUuid