Class shardimage\shardimagephpapi\helpers\FileHelper

Inheritanceshardimage\shardimagephpapi\helpers\FileHelper

Helper methods for file-related operations.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
addFile() Adds a file reference to the local storage. shardimage\shardimagephpapi\helpers\FileHelper
deleteFiles() Removes all file references for a content ID or globally. shardimage\shardimagephpapi\helpers\FileHelper
getFilename() Returns the filename of a file resource. shardimage\shardimagephpapi\helpers\FileHelper
getFiles() Returns all file references for a content ID. shardimage\shardimagephpapi\helpers\FileHelper
getFilesize() Returns the size of a file. shardimage\shardimagephpapi\helpers\FileHelper
getMimeType() Return the mime type of a file. shardimage\shardimagephpapi\helpers\FileHelper
processFiles() Reinserts all files into the referenced content. shardimage\shardimagephpapi\helpers\FileHelper

Method Details

addFile() public static method

Adds a file reference to the local storage.

public static void addFile ( $refId, $refAttribute, $file )
$refId string

Reference content ID

$refAttribute string

Reference attribute (parameter or field of model)

$file mixed

File

deleteFiles() public static method

Removes all file references for a content ID or globally.

public static void deleteFiles ( $service, $refId null )
$service shardimage\shardimagephpapi\services\BaseService

Service

$refId string

Reference content ID

getFilename() public static method

Returns the filename of a file resource.

public static string|null getFilename ( $resource )
$resource resource

File resource

getFiles() public static method

Returns all file references for a content ID.

public static shardimage\shardimagephpapi\web\FileReference[] getFiles ( $refId )
$refId string

Reference content ID

getFilesize() public static method

Returns the size of a file.

public static integer getFilesize ( $file )
$file string|resource

File content or resource

getMimeType() public static method

Return the mime type of a file.

public static string getMimeType ( $file )
$file string|resource

File content or resource

processFiles() public static method

Reinserts all files into the referenced content.

public static void processFiles ( &$array, $refId )
$array array

Content

$refId string

Content ID