TwistPHP Documentation

addField

File path: dist/twist/Core/Models/Database/TableStructure.model.php
Namespace: Twist\Core\Models\Database
Extends:

addFieldAdd a field into the table, the fields will be added into the table in the order they have been entered

Parameters

Name Type Description
$strColumnNamestringn/a
$strDataTypestringn/a
[$mxdCharLength = null]mixedn/a
[$strDefaultValue = null]stringn/a
[$blNullable = false]booleann/a

Return Values

void — No return information has been documented for this function.

Example

<?php
//Set the variables for the example
$strColumnName 'foo';
$strDataType 'foo';
$mxdCharLength null;
$strDefaultValue null;
$blNullable false;

//Call the function addField with the example vars
$resTableStructure = new \Twist\Core\Models\Database\TableStructure();
$resTableStructure -> addField($strColumnName$strDataType$mxdCharLength$strDefaultValue$blNullable);