Brimbox Logo Brimbox Version 2.3.4 Released

unique_key>>

Build a subquery to handle a primary key constraint.

Class: bb_database, called as $main

File: bb_database.php (php)

Declaration:

function unique_key($edit_or_insert, &$select_where_not, $unique_key, $unique_value, $row_type, $post_key)

Usage:

$main->unique_key($edit_or_insert, &$select_where_not, $unique_key, $unique_value, $row_type, $post_key);

Note: this function called in pluggable function bb_data_table_row_input.

Parameter: $edit_or_insert (integer)
Whether record is being inserted or updated.

Parameter: $select_where_not (array)
Empty array passed as reference and populated with a subquery suitable for a WHERE NOT EXISTS clause in an update or insert statement.

Parameter: $unique_key (array)
The col_type of the unique key.

Parameter: $unique_value (string)
Value to be checked for uniqueness.

Parameter: $row_type (integer)
The row_type of the layout being inserted or updated.

Parameter: $post_key (integer)
The id of the record being updated when applicable.

Updated: 2016-07-09