Class shardimage\shardimagephpapi\helpers\FileHelper
Inheritance | shardimage\shardimagephpapi\helpers\FileHelper |
---|
Helper methods for file-related operations.
Public Methods
Method | Description | Defined 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
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 |
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 |
Returns the filename of a file resource.
public static string|null getFilename ( $resource ) | ||
$resource | resource | File resource |
Returns all file references for a content ID.
public static shardimage\shardimagephpapi\web\FileReference[] getFiles ( $refId ) | ||
$refId | string | Reference content ID |
Returns the size of a file.
public static integer getFilesize ( $file ) | ||
$file | string|resource | File content or resource |
Return the mime type of a file.
public static string getMimeType ( $file ) | ||
$file | string|resource | File content or resource |
Reinserts all files into the referenced content.
public static void processFiles ( &$array, $refId ) | ||
$array | array | Content |
$refId | string | Content ID |