PHP Class Ulaform_Driver_Sql, horde

Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Marko Djukic ([email protected])
Author: Vilius Šumskas ([email protected])
Inheritance: extends Ulaform_Driver
Mostra file Open project: horde/horde

Protected Properties

Property Type Description
$_charset string Charset
$_db Horde_Db_Adapter The database connection object.

Public Methods

Method Description
__construct ( array $params = [] ) Construct a new SQL storage object.
deleteField ( integer $field_id ) : boolean Deletes a field from the database.
deleteForm ( integer $form_id ) : boolean Deletes a form and all of its fields from the database.
getAvailableForms ( ) : array Fetches the a list of available forms to use.
getFields ( integer $form_id, $field_id = null ) : array Fetches the fields for a particular form.
getForm ( integer $form_id, $permission = Horde_Perms::SHOW ) : array Fetches all the data specific to the supplied form id.
getForms ( $form_id = null ) : array Fetches the a list of available forms and the basic data.
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.
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.
sortFields ( array &$info ) : boolean Sets the specified sort order to the fields in a form.

Protected Methods

Method Description
_nextFieldOrder ( integer $form_id ) : integer Gets the next field order position within a form.

Method Details

__construct() public method

Construct a new SQL storage object.
public __construct ( array $params = [] )
$params array The connection parameters

_nextFieldOrder() protected method

Gets the next field order position within a form.
protected _nextFieldOrder ( integer $form_id ) : integer
$form_id integer
return integer

deleteField() public method

Deletes a field from the database.
public deleteField ( integer $field_id ) : boolean
$field_id integer The field id of the field to delete.
return boolean True on success.

deleteForm() public method

Deletes a form and all of its fields from the database.
public deleteForm ( integer $form_id ) : boolean
$form_id integer The form id of the form to delete.
return boolean True on success.

getAvailableForms() public method

Fetches the a list of available forms to use.
public getAvailableForms ( ) : array
return array An array of the available forms.

getFields() public method

Fetches the fields for a particular form.
public getFields ( integer $form_id, $field_id = null ) : array
$form_id integer The form id of the form to return.
return array The fields.

getForm() public method

Fetches all the data specific to the supplied form id.
public getForm ( integer $form_id, $permission = Horde_Perms::SHOW ) : array
$form_id integer The form id of the form to return.
return array The form data.

getForms() public method

Fetches the a list of available forms and the basic data.
public getForms ( $form_id = null ) : array
return array An array of the available forms.

saveField() public method

If no form_id is available will throw an exception.
public saveField ( &$info ) : boolean
return boolean True on success.

saveForm() public method

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.
public saveForm ( array &$info ) : integer
$info array An array with the form details.
return integer The form id.

sortFields() public method

Sets the specified sort order to the fields in a form.
public sortFields ( array &$info ) : boolean
$info array An array with the field ids in a specific order.
return boolean True on success.

Property Details

$_charset protected_oe property

Charset
protected string $_charset
return string

$_db protected_oe property

The database connection object.
protected Horde_Db_Adapter $_db
return Horde_Db_Adapter