TwistPHP Documentation

addUniqueKey

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

addUniqueKeySet a unique key, you can have multiple unique keys per table. To create a unique key from more than 1 field pass the second parameter as an array of fields

Parameters

Name Type Description
$strNamestringn/a
$mxdColumnsmixedn/a
[$strComment = null]stringn/a

Return Values

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

Example

<?php
//Set the variables for the example
$strName 'foo';
$mxdColumns 'foo-123';
$strComment null;

//Call the function addUniqueKey with the example vars
$resTableStructure = new \Twist\Core\Models\Database\TableStructure();
$resTableStructure -> addUniqueKey($strName$mxdColumns$strComment);