Function __global->_helper_alter_table_field

Definitions

sources/database_helper.php

  • Change the type of a DB field in a table.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$this_ref object No No required parameter N/A N/A Link to the real database object
$table_name ID_TEXT No No required parameter N/A N/A The table name
$name ID_TEXT No No required parameter N/A N/A The field name
$type ID_TEXT No No required parameter N/A N/A The new field type
$new_name ?ID_TEXT No No Null N/A N/A The new field name (null: leave name)

Returns

  • Whether we failed to set an auto-increment
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Change the type of a DB field in a table.
 *
 * @param  object $this_ref Link to the real database object
 * @param  ID_TEXT $table_name The table name
 * @param  ID_TEXT $name The field name
 * @param  ID_TEXT $type The new field type
 * @param  ?ID_TEXT $new_name The new field name (null: leave name)
 * @return boolean Whether we failed to set an auto-increment
 */

function _helper_alter_table_field(object $this_ref, string $table_name, string $name, string $type, ?string $new_name = null) : bool