PHP Class Craft\AmForms_FormsService

Inheritance: extends craft\BaseApplicationComponent
Afficher le fichier Open project: am-impact/amforms

Méthodes publiques

Méthode 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 méthode

Delete a form.
public deleteForm ( AmForms_FormModel $form ) : boolean
$form AmForms_FormModel
Résultat boolean

displayField() public méthode

Display a field.
public displayField ( AmForms_FormModel $form, string $handle ) : string
$form AmForms_FormModel
$handle string
Résultat string

displayForm() public méthode

Display a form.
public displayForm ( AmForms_FormModel $form ) : string
$form AmForms_FormModel
Résultat string

getAllForms() public méthode

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

getCriteria() public méthode

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

getFormByHandle() public méthode

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

getFormById() public méthode

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

getNamespaceForForm() public méthode

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

getUniqueNameAndHandle() public méthode

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

saveForm() public méthode

Save a form.
public saveForm ( AmForms_FormModel $form ) : boolean
$form AmForms_FormModel
Résultat boolean