Function __global->get_translated_tempcode__and_simplify

Definitions

sources/lang.php

  • Wrapper for get_translated_tempcode, which then converts complex Tempcode back to very simple flat Tempcode, as an optimisation.We won't normally call this as it breaks our architecture, but webmaster may request it if they are okay with it.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$table ID_TEXT No No required parameter N/A N/A The table name
$row array No No required parameter N/A N/A The table row. Must not have aspects of other tables in it (i.e. joins). Pre-filter using 'db_map_restrict' if required
$field_name ID_TEXT No No required parameter N/A N/A The field name
$db ?object No No Null N/A N/A The database connector to use (null: standard site connector)
$lang ?LANGUAGE_NAME No No Null N/A N/A The language (null: uses the current language)
$force boolean No No False N/A N/A Whether to force it to the specified language
$as_admin boolean No No False N/A N/A Whether to force as_admin, even if the content language string isn't stored against an admin (designed for Comcode page caching)
$clear_away_from_cache boolean No No False N/A N/A Whether to remove from the Tempcode cache when we're done, for performance reasons (normally don't bother with this, but some code knows it won't be needed again -- esp Comcode cache layer -- and saves RAM by removing it)

Returns

  • The parsed Comcode (null: the text couldn't be looked up)
  • Type: ?Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Wrapper for get_translated_tempcode, which then converts complex Tempcode back to very simple flat Tempcode, as an optimisation.We won't normally call this as it breaks our architecture, but webmaster may request it if they are okay with it.
 *
 * @param  ID_TEXT $table The table name
 * @param  array $row The table row. Must not have aspects of other tables in it (i.e. joins). Pre-filter using 'db_map_restrict' if required
 * @param  ID_TEXT $field_name The field name
 * @param  ?object $db The database connector to use (null: standard site connector)
 * @param  ?LANGUAGE_NAME $lang The language (null: uses the current language)
 * @param  boolean $force Whether to force it to the specified language
 * @param  boolean $as_admin Whether to force as_admin, even if the content language string isn't stored against an admin (designed for Comcode page caching)
 * @param  boolean $clear_away_from_cache Whether to remove from the Tempcode cache when we're done, for performance reasons (normally don't bother with this, but some code knows it won't be needed again -- esp Comcode cache layer -- and saves RAM by removing it)
 * @return ?Tempcode The parsed Comcode (null: the text couldn't be looked up)
 */

function get_translated_tempcode__and_simplify(string $table, array $row, string $field_name, ?object $db = null, ?string $lang = null, bool $force = false, bool $as_admin = false, bool $clear_away_from_cache = false) : ?object