Function __global->insert_lang_comcode_attachments

Definitions

sources/attachments2.php

  • Insert some Comcode content that may contain attachments, and return details of the content language string.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$field_name ID_TEXT No No required parameter N/A N/A The field name
$level integer No No required parameter 1 2 3 4 N/A The level of importance this content language string holds
$text LONG_TEXT No No required parameter N/A N/A The Comcode content
$type ID_TEXT No No null N/A N/A The arbitrary type that the attached is for (e.g. download)
$id ID_TEXT No No Blank (empty string) N/A N/A The ID in the set of the arbitrary types that the attached is for
$db ?object No No Null N/A N/A The database connector to use (null: standard site connector)
$insert_as_admin boolean No No False N/A N/A Whether to insert it as an admin (any Comcode parsing will be carried out with admin privileges)
$for_member ?MEMBER No No Null N/A N/A The member to use for ownership permissions (null: current member)

Returns

  • The content language string save fields
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Insert some Comcode content that may contain attachments, and return details of the content language string.
 *
 * @param  ID_TEXT $field_name The field name
 * @param  integer $level The level of importance this content language string holds
 * @set 1 2 3 4
 * @param  LONG_TEXT $text The Comcode content
 * @param  ID_TEXT $type The arbitrary type that the attached is for (e.g. download)
 * @param  ID_TEXT $id The ID in the set of the arbitrary types that the attached is for
 * @param  ?object $db The database connector to use (null: standard site connector)
 * @param  boolean $insert_as_admin Whether to insert it as an admin (any Comcode parsing will be carried out with admin privileges)
 * @param  ?MEMBER $for_member The member to use for ownership permissions (null: current member)
 * @return array The content language string save fields
 */

function insert_lang_comcode_attachments(string $field_name, int $level, string $text, string $type = 'null', string $id = '', ?object $db = null, bool $insert_as_admin = false, ?int $for_member = null) : array