\Ulaform_Driver_Sql

Ulaform_Driver_Sql Class

Copyright 2003-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Summary

Methods
Properties
Constants
__construct()
getFormsList()
getFieldsList()
getFieldsArray()
getField()
submitForm()
hasPermission()
saveForm()
saveField()
sortFields()
getForms()
getAvailableForms()
getForm()
getFields()
deleteForm()
deleteField()
No public properties found
No constants found
_nextFieldOrder()
$_params
$_driver
$_db
$_charset
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

A hash containing any parameters for the current driver.

Type

array

$_driver

$_driver : 

Type

$_db

$_db : \Horde_Db_Adapter

The database connection object.

Type

\Horde_Db_Adapter

$_charset

$_charset : string

Charset

Type

string

Methods

__construct()

__construct(array  $params = array()) 

Construct a new SQL storage object.

Parameters

array $params

The connection parameters

Throws

\InvalidArguementException

getFormsList()

getFormsList() : array

Get a list of forms.

Throws

\Ulaform_Exception

Returns

array —

Array of the available forms.

getFieldsList()

getFieldsList(  $form_id) : array

Get a list of fields that belong to a forms.

Parameters

$form_id

Throws

\Horde_Exception_PermissionDenied
\Horde_Exception_NotFound
\Ulaform_Exception

Returns

array —

Array of the available fields for a specific form.

getFieldsArray()

getFieldsArray(  $form_id) : array

Get a list of fields that belong to a forms as a simple array.

Parameters

$form_id

Throws

\Horde_Exception_PermissionDenied
\Horde_Exception_NotFound
\Ulaform_Exception

Returns

array —

Array of the available fields for a specific form.

getField()

getField(  $form_id,   $field_id) 

Parameters

$form_id
$field_id

submitForm()

submitForm(  $form_data) 

Parameters

$form_data

hasPermission()

hasPermission(  $perm = \Horde_Perms::SHOW,   $form_id = null) 

Parameters

$perm
$form_id

saveForm()

saveForm(array  $info) : integer

Saves the passed form into the db, either inserting a new form if no form_id is available, or updating an existing form if a form_id has been passed.

Parameters

array $info

An array with the form details.

Throws

\Ulaform_Exception

Returns

integer —

The form id.

saveField()

saveField(  $info) : boolean

Saves the passed field into the db, either inserting a new field if no field_id is available, or updating an existing field if a field_id has been passed.

If no form_id is available will throw an exception.

Parameters

$info

Throws

\Horde_Exception_NotFound
\Ulaform_Exception

Returns

boolean —

True on success.

sortFields()

sortFields(array  $info) : boolean

Sets the specified sort order to the fields in a form.

Parameters

array $info

An array with the field ids in a specific order.

Throws

\Horde_Exception_NotFound
\Ulaform_Exception

Returns

boolean —

True on success.

getForms()

getForms(  $form_id = null) : array

Fetches the a list of available forms and the basic data.

Parameters

$form_id

Throws

\Ulaform_Exception

Returns

array —

An array of the available forms.

getAvailableForms()

getAvailableForms() : array

Fetches the a list of available forms to use.

Throws

\Ulaform_Exception

Returns

array —

An array of the available forms.

getForm()

getForm(integer  $form_id,   $permission = \Horde_Perms::SHOW) : array

Fetches all the data specific to the supplied form id.

Parameters

integer $form_id

The form id of the form to return.

$permission

Throws

\Horde_Exception_PermissionDenied
\Horde_Exception_NotFound
\Ulaform_Exception

Returns

array —

The form data.

getFields()

getFields(integer  $form_id,   $field_id = null) : array

Fetches the fields for a particular form.

Parameters

integer $form_id

The form id of the form to return.

$field_id

Throws

\Ulaform_Exception

Returns

array —

The fields.

deleteForm()

deleteForm(integer  $form_id) : boolean

Deletes a form and all of its fields from the database.

Parameters

integer $form_id

The form id of the form to delete.

Throws

\Ulaform_Exception

Returns

boolean —

True on success.

deleteField()

deleteField(integer  $field_id) : boolean

Deletes a field from the database.

Parameters

integer $field_id

The field id of the field to delete.

Throws

\Ulaform_Exception

Returns

boolean —

True on success.

_nextFieldOrder()

_nextFieldOrder(integer  $form_id) : integer

Gets the next field order position within a form.

Parameters

integer $form_id

Throws

\Ulaform_Exception

Returns

integer