PHP Class Craft\AmForms_FormsService

Inheritance: extends craft\BaseApplicationComponent
Datei anzeigen Open project: am-impact/amforms

Public Methods

Method Description
deleteForm ( AmForms_FormModel $form ) : boolean Delete a form.
displayField ( AmForms_FormModel $form, string $handle ) : string Display a field.
displayForm ( AmForms_FormModel $form ) : string Display a form.
getAllForms ( $indexBy = 'id' ) : AmForms_FormModel | array | null Get all forms.
getCriteria ( array $attributes = [] ) : craft\ElementCriteriaModel Returns a criteria model for AmForms_Form elements.
getFormByHandle ( string $handle ) : AmForms_FormModel | null Get a form by its handle.
getFormById ( integer $id ) : AmForms_FormModel | null Get a form by its ID.
getNamespaceForForm ( AmForms_FormModel $form, boolean $createNewOnEmpty = true ) : false | string Get a namespace for a form.
getUniqueNameAndHandle ( AmForms_FormModel $form ) Get unique name and handle for a form.
saveForm ( AmForms_FormModel $form ) : boolean Save a form.

Method Details

deleteForm() public method

Delete a form.
public deleteForm ( AmForms_FormModel $form ) : boolean
$form AmForms_FormModel
return boolean

displayField() public method

Display a field.
public displayField ( AmForms_FormModel $form, string $handle ) : string
$form AmForms_FormModel
$handle string
return string

displayForm() public method

Display a form.
public displayForm ( AmForms_FormModel $form ) : string
$form AmForms_FormModel
return string

getAllForms() public method

Get all forms.
public getAllForms ( $indexBy = 'id' ) : AmForms_FormModel | array | null
return AmForms_FormModel | array | null

getCriteria() public method

Returns a criteria model for AmForms_Form elements.
public getCriteria ( array $attributes = [] ) : craft\ElementCriteriaModel
$attributes array
return craft\ElementCriteriaModel

getFormByHandle() public method

Get a form by its handle.
public getFormByHandle ( string $handle ) : AmForms_FormModel | null
$handle string
return AmForms_FormModel | null

getFormById() public method

Get a form by its ID.
public getFormById ( integer $id ) : AmForms_FormModel | null
$id integer
return AmForms_FormModel | null

getNamespaceForForm() public method

Get a namespace for a form.
public getNamespaceForForm ( AmForms_FormModel $form, boolean $createNewOnEmpty = true ) : false | string
$form AmForms_FormModel
$createNewOnEmpty boolean
return false | string

getUniqueNameAndHandle() public method

Get unique name and handle for a form.
public getUniqueNameAndHandle ( AmForms_FormModel $form )
$form AmForms_FormModel

saveForm() public method

Save a form.
public saveForm ( AmForms_FormModel $form ) : boolean
$form AmForms_FormModel
return boolean