Function __global->_helper_add_table_field
Definitions
sources/database_helper.php
- Adds a field to an existing table.Note: this function cannot add a new AUTO key, use add_auto_key for that.Note: this function cannot change the keys in the database on its own (use change_primary_key for that), although you should include * if something will be a key.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
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 field type |
| $default | ?mixed | No | No | Null | N/A | N/A | The default value; for a translatable field should still be a string value (null: null default / default default) |
Preview
Code (PHP)
/**
* Adds a field to an existing table.Note: this function cannot add a new AUTO key, use add_auto_key for that.Note: this function cannot change the keys in the database on its own (use change_primary_key for that), although you should include * if something will be a key.
*
* @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 field type
* @param ?mixed $default The default value; for a translatable field should still be a string value (null: null default / default default)
*/
function _helper_add_table_field(object $this_ref, string $table_name, string $name, string $type, $default = null)
* Adds a field to an existing table.Note: this function cannot add a new AUTO key, use add_auto_key for that.Note: this function cannot change the keys in the database on its own (use change_primary_key for that), although you should include * if something will be a key.
*
* @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 field type
* @param ?mixed $default The default value; for a translatable field should still be a string value (null: null default / default default)
*/
function _helper_add_table_field(object $this_ref, string $table_name, string $name, string $type, $default = null)

