Function Resource_fs_base->convert_filename_to_id
Definitions
sources/resource_fs_base_class.php
- Get the resource ID for a filename (of file or 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 | required parameter | N/A | N/A | The resource type |
Returns
- A pair: The resource type, the resource ID (null: could not find)
- Type: ?array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get the resource ID for a filename (of file or 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
* @return ?array A pair: The resource type, the resource ID (null: could not find)
*/
public function convert_filename_to_id(string $filename, string $resource_type) : ?array
* Get the resource ID for a filename (of file or 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
* @return ?array A pair: The resource type, the resource ID (null: could not find)
*/
public function convert_filename_to_id(string $filename, string $resource_type) : ?array

