Function Resource_fs_base->resource_add
Definitions
sources/resource_fs_base_class.php
- Adds some resource with the given label and properties. Wraps file_add/folder_add.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $resource_type | ID_TEXT | No | No | required parameter | N/A | N/A | Resource type |
| $label | LONG_TEXT | No | No | required parameter | N/A | N/A | Filename OR Resource label |
| $path | string | No | No | required parameter | N/A | N/A | The path (blank: root / not applicable) |
| $properties | array | No | No | [] | N/A | N/A | Properties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields) |
Returns
- The resource ID (false: error, could not create via these properties / here)
- Type: ~ID_TEXT
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Adds some resource with the given label and properties. Wraps file_add/folder_add.
*
* @param ID_TEXT $resource_type Resource type
* @param LONG_TEXT $label Filename OR Resource label
* @param string $path The path (blank: root / not applicable)
* @param array $properties Properties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields)
* @return ~ID_TEXT The resource ID (false: error, could not create via these properties / here)
*/
public function resource_add(string $resource_type, string $label, string $path, array $properties = [])
* Adds some resource with the given label and properties. Wraps file_add/folder_add.
*
* @param ID_TEXT $resource_type Resource type
* @param LONG_TEXT $label Filename OR Resource label
* @param string $path The path (blank: root / not applicable)
* @param array $properties Properties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields)
* @return ~ID_TEXT The resource ID (false: error, could not create via these properties / here)
*/
public function resource_add(string $resource_type, string $label, string $path, array $properties = [])

