Function Hook_commandr_fs_forum_groupings->file_add

Definitions

sources/hooks/systems/commandr_fs/forum_groupings.php

  • Standard Commandr-fs add function for resource-fs hooks. Adds some resource with the given label and properties.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$filename 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 required parameter N/A N/A Properties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields)
$force_type ?ID_TEXT No No Null N/A N/A Resource type to try to force (null: do not force)

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)

/**
 * Standard Commandr-fs add function for resource-fs hooks. Adds some resource with the given label and properties.
 *
 * @param  LONG_TEXT $filename 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)
 * @param  ?ID_TEXT $force_type Resource type to try to force (null: do not force)
 * @return ~ID_TEXT The resource ID (false: error, could not create via these properties / here)
 */

public function file_add(string $filename, string $path, array $properties, ?string $force_type = null)