Function Resource_fs_base->folder_convert_filename_to_id
Definitions
sources/resource_fs_base_class.php
- Get the resource ID for a filename (of folder). Note that filenames are unique across all folders in a filesystem.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $filename | ID_TEXT | No | No | required parameter | N/A | N/A | The filename, or filepath |
| $resource_type | ?ID_TEXT | No | No | Null | N/A | N/A | The resource type (null: assumption of only one folder resource type for this hook; only passed as non-null from overridden functions within hooks that are calling this as a helper function) |
Returns
- A pair: The resource type, the resource ID
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get the resource ID for a filename (of folder). Note that filenames are unique across all folders in a filesystem.
*
* @param ID_TEXT $filename The filename, or filepath
* @param ?ID_TEXT $resource_type The resource type (null: assumption of only one folder resource type for this hook; only passed as non-null from overridden functions within hooks that are calling this as a helper function)
* @return array A pair: The resource type, the resource ID
*/
public function folder_convert_filename_to_id(string $filename, ?string $resource_type = null) : array
* Get the resource ID for a filename (of folder). Note that filenames are unique across all folders in a filesystem.
*
* @param ID_TEXT $filename The filename, or filepath
* @param ?ID_TEXT $resource_type The resource type (null: assumption of only one folder resource type for this hook; only passed as non-null from overridden functions within hooks that are calling this as a helper function)
* @return array A pair: The resource type, the resource ID
*/
public function folder_convert_filename_to_id(string $filename, ?string $resource_type = null) : array

