src/CarteBlanche/Library/StorageEngine/Database.php
public function build_fields_array($table_structure = null)
    {
        if (empty($table_structure) || !is_array($table_structure)) return;
        $table_structure_ar=array();
        foreach($table_structure as $index=>$form) {
            if (is_string($form))
                $table_structure_ar[] = $index.' '.$form;
            else
                $table_structure_ar[] = $index.' '.$form['type'].' '
                    .( (!empty($form['null']) && $form['null']==true) ? 'null' : 'not null').' '
                    .(!empty($form['default']) ? 'default \''.$form['default'].'\'' : '').' '
                    .(!empty($form['index']) ? $form['index'] : '');
        }
        return $table_structure_ar;
    }
public function build_fields_array($table_structure = null)
    {
        if (empty($table_structure) || !is_array($table_structure)) return;
        $table_structure_ar=array();
        foreach($table_structure as $index=>$form) {
            if (is_string($form))
                $table_structure_ar[] = $index.' '.$form;
            else
                $table_structure_ar[] = $index.' '.$form['type'].' '
                    .( (!empty($form['null']) && $form['null']==true) ? 'null' : 'not null').' '
                    .(!empty($form['default']) ? 'default \''.$form['default'].'\'' : '').' '
                    .(!empty($form['index']) ? $form['index'] : '');
        }
        return $table_structure_ar;
    }
Build a query string to add a field in a table

@param array $table_structure The structure of the field
@return string The query string to create the field