PHP Class Backend\Modules\FormBuilder\Engine\Model

Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
calculateTimeAgo ( integer $timestamp ) : string Calculate time ago.
createIdentifier ( ) : string Create an unique identifier.
delete ( integer $id ) Delete an item.
deleteData ( array $ids ) Deletes one or more data items.
deleteField ( integer $id ) Delete a field.
deleteFieldValidation ( integer $id ) Delete all validation of a field.
exists ( integer $id ) : boolean Does the item exist.
existsData ( integer $id ) : boolean Does the data item exist.
existsField ( integer $id, integer $formId = null ) : boolean Does a field exist (within a form).
existsIdentifier ( string $identifier, integer $ignoreId = null ) : boolean Does an identifier exist.
formatRecipients ( string $string ) : string Formats the recipients based on the serialized string
get ( integer $id ) : array Get all data for a given id.
getData ( integer $id ) : array Get data for a given id.
getErrors ( string $type = null ) : mixed Get errors (optional by type).
getField ( integer $id ) : array Get a field.
getFields ( integer $id ) : array Get all fields of a form.
getLocale ( string $name, string $type = 'label', string $application = 'Backend' ) : string Get a label/action/message from locale.
getMaximumSequence ( integer $formId ) : integer Get the maximum sequence for fields in a form.
insert ( array $values ) : integer Add a new item.
insertField ( array $values ) : integer Add a new field.
insertFieldValidation ( array $values ) : integer Add validation for a field.
update ( integer $id, array $values ) : integer Update an existing item.
updateField ( integer $id, array $values ) : integer Update a field.

Private Methods

Method Description
identifierExist ( string $identifier ) : boolean

Method Details

calculateTimeAgo() public static method

Calculate time ago.
public static calculateTimeAgo ( integer $timestamp ) : string
$timestamp integer Unix timestamp from the past.
return string

createIdentifier() public static method

Create an unique identifier.
public static createIdentifier ( ) : string
return string

delete() public static method

Delete an item.
public static delete ( integer $id )
$id integer The id of the record to delete.

deleteData() public static method

Deletes one or more data items.
public static deleteData ( array $ids )
$ids array Ids of data items.

deleteField() public static method

Delete a field.
public static deleteField ( integer $id )
$id integer Id of a field.

deleteFieldValidation() public static method

Delete all validation of a field.
public static deleteFieldValidation ( integer $id )
$id integer Id of a field.

exists() public static method

Does the item exist.
public static exists ( integer $id ) : boolean
$id integer Id of a form.
return boolean

existsData() public static method

Does the data item exist.
public static existsData ( integer $id ) : boolean
$id integer Id of the data item.
return boolean

existsField() public static method

Does a field exist (within a form).
public static existsField ( integer $id, integer $formId = null ) : boolean
$id integer Id of a field.
$formId integer Id of a form.
return boolean

existsIdentifier() public static method

Does an identifier exist.
public static existsIdentifier ( string $identifier, integer $ignoreId = null ) : boolean
$identifier string Identifier.
$ignoreId integer Field id to ignore.
return boolean

formatRecipients() public static method

Formats the recipients based on the serialized string
public static formatRecipients ( string $string ) : string
$string string The serialized string that should be formatted
return string

get() public static method

Get all data for a given id.
public static get ( integer $id ) : array
$id integer The id for the record to get.
return array

getData() public static method

Get data for a given id.
public static getData ( integer $id ) : array
$id integer The id for the record to get.
return array

getErrors() public static method

Get errors (optional by type).
public static getErrors ( string $type = null ) : mixed
$type string Type of error.
return mixed

getField() public static method

Get a field.
public static getField ( integer $id ) : array
$id integer Id of a field.
return array

getFields() public static method

Get all fields of a form.
public static getFields ( integer $id ) : array
$id integer Id of a form.
return array

getLocale() public static method

Used as datagridfunction.
public static getLocale ( string $name, string $type = 'label', string $application = 'Backend' ) : string
$name string Name of the locale item.
$type string Type of locale item.
$application string Name of the application.
return string

getMaximumSequence() public static method

Get the maximum sequence for fields in a form.
public static getMaximumSequence ( integer $formId ) : integer
$formId integer Id of the form.
return integer

insert() public static method

Add a new item.
public static insert ( array $values ) : integer
$values array The data to insert.
return integer

insertField() public static method

Add a new field.
public static insertField ( array $values ) : integer
$values array The data to insert.
return integer

insertFieldValidation() public static method

Add validation for a field.
public static insertFieldValidation ( array $values ) : integer
$values array The data to insert.
return integer

update() public static method

Update an existing item.
public static update ( integer $id, array $values ) : integer
$id integer The id for the item to update.
$values array The new data.
return integer

updateField() public static method

Update a field.
public static updateField ( integer $id, array $values ) : integer
$id integer The id for the item to update.
$values array The new data.
return integer