Function Resource_fs_base->convert_label_to_filename

Definitions

sources/resource_fs_base_class.php

  • Convert a label to a filename, possibly with auto-creating if needed. This is useful for the software-side resource-agnostic API.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$label LONG_TEXT No No required parameter N/A N/A Resource label
$subpath string No No required parameter N/A N/A The path (blank: root / not applicable). It may end in "/*" if you want to look for a match under a certain directory
$resource_type ID_TEXT No No required parameter N/A N/A Resource type
$must_already_exist boolean No No False N/A N/A Whether the content must already exist
$use_guid_for_new ?ID_TEXT No No Null N/A N/A GUID to auto-create with (null: either not auto-creating, or not specifying the GUID if we are)

Returns

  • The filename (null: not found)
  • Type: ?ID_TEXT
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Convert a label to a filename, possibly with auto-creating if needed. This is useful for the software-side resource-agnostic API.
 *
 * @param  LONG_TEXT $label Resource label
 * @param  string $subpath The path (blank: root / not applicable). It may end in "/*" if you want to look for a match under a certain directory
 * @param  ID_TEXT $resource_type Resource type
 * @param  boolean $must_already_exist Whether the content must already exist
 * @param  ?ID_TEXT $use_guid_for_new GUID to auto-create with (null: either not auto-creating, or not specifying the GUID if we are)
 * @return ?ID_TEXT The filename (null: not found)
 */

public function convert_label_to_filename(string $label, string $subpath, string $resource_type, bool $must_already_exist = false, ?string $use_guid_for_new = null) : ?string