PHP Class Contao\FilesModel

The files themselves reside in the files directory. This class only handles the corresponding database entries (database aided file system).
Inheritance: extends Model
显示文件 Open project: contao/core-bundle Class Usage Examples

Protected Properties

Property Type Description
$strTable string Table name

Public Methods

Method Description
findById ( mixed $intId, array $arrOptions = [] ) : FilesModel | null Find a file by its ID or UUID
findByPath ( string $path, array $arrOptions = [] ) : FilesModel | null Find a file by its path
findByPk ( mixed $varValue, array $arrOptions = [] ) : FilesModel | null Find a file by its primary key
findByUuid ( string $strUuid, array $arrOptions = [] ) : FilesModel | null Find a file by its UUID
findMultipleByBasepath ( string $strPath, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null Find multiple files with the same base path
findMultipleByIds ( array $arrIds, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null Find multiple files by their IDs or UUIDs
findMultipleByPaths ( array $arrPaths, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null Find multiple files by their paths
findMultipleByUuids ( array $arrUuids, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null Find multiple files by their UUIDs
findMultipleByUuidsAndExtensions ( array $arrUuids, array $arrExtensions, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null Find multiple files by UUID and a list of extensions
findMultipleFilesByFolder ( string $strPath, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null Find all files in a folder

Protected Methods

Method Description
postSave ( integer $intType ) Do not reload the data upon insert

Method Details

findById() public static method

Find a file by its ID or UUID
public static findById ( mixed $intId, array $arrOptions = [] ) : FilesModel | null
$intId mixed The ID or UUID
$arrOptions array An optional options array
return FilesModel | null The model or null if there is no file

findByPath() public static method

Find a file by its path
public static findByPath ( string $path, array $arrOptions = [] ) : FilesModel | null
$path string The path
$arrOptions array An optional options array
return FilesModel | null The model or null if there is no file

findByPk() public static method

Find a file by its primary key
public static findByPk ( mixed $varValue, array $arrOptions = [] ) : FilesModel | null
$varValue mixed The value
$arrOptions array An optional options array
return FilesModel | null The model or null if there is no file

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

findMultipleByBasepath() public static method

Find multiple files with the same base path
public static findMultipleByBasepath ( string $strPath, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null
$strPath string The base path
$arrOptions array An optional options array
return Contao\Model\Collection | FilesModel[] | FilesModel | null A collection of models or null if there are no matching files

findMultipleByIds() public static method

Find multiple files by their IDs or UUIDs
public static findMultipleByIds ( array $arrIds, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null
$arrIds array An array of IDs or UUIDs
$arrOptions array An optional options array
return Contao\Model\Collection | FilesModel[] | FilesModel | null A collection of models or null if there are no files

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

findMultipleByUuids() public static method

Find multiple files by their UUIDs
public static findMultipleByUuids ( array $arrUuids, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null
$arrUuids array An array of UUIDs
$arrOptions array An optional options array
return Contao\Model\Collection | FilesModel[] | FilesModel | null A collection of models or null if there are no files

findMultipleByUuidsAndExtensions() public static method

Find multiple files by UUID and a list of extensions
public static findMultipleByUuidsAndExtensions ( array $arrUuids, array $arrExtensions, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null
$arrUuids array An array of file UUIDs
$arrExtensions array An array of file extensions
$arrOptions array An optional options array
return Contao\Model\Collection | FilesModel[] | FilesModel | null A collection of models or null of there are no matching files

findMultipleFilesByFolder() public static method

Find all files in a folder
public static findMultipleFilesByFolder ( string $strPath, array $arrOptions = [] ) : Collection | FilesModel[] | FilesModel | null
$strPath string The folder path
$arrOptions array An optional options array
return Contao\Model\Collection | FilesModel[] | FilesModel | null A collection of models or null if there are no matching files

postSave() protected method

Do not reload the data upon insert
protected postSave ( integer $intType )
$intType integer The query type (Model::INSERT or Model::UPDATE)

Property Details

$strTable protected_oe static_oe property

Table name
protected static string $strTable
return string