Contentserv PHP API

CSOpenSearchFormSection extends CSOpenSearchFormField
in package

Represents an OpenSearch Form Field of type: Input (by Default)

Tags

Table of Contents

__construct()  : mixed
Initializes the Form Section with its name
addCheckboxField()  : CSOpenSearchFormCheckboxField
Adds a new instance of CSOpenSearchFormCheckboxField to current field set.
addDateField()  : CSOpenSearchFormDateField
Adds a new instance of CSOpenSearchFormDateField to current field set.
addField()  : CSOpenSearchFormField
Adds various fields to the field set.
addFieldByType()  : CSOpenSearchFormField
Adds a new instance of CSOpenSearchFormField to current field set.
addInputField()  : CSOpenSearchFormField
Adds a new instance of CSOpenSearchFormField to current field set.
addSelectField()  : CSOpenSearchFormSelectField
Adds a new instance of CSOpenSearchFormSelectField to current field set.
addSubSection()  : CSOpenSearchFormSubSection
Adds a new instance of CSOpenSearchFormSectionField to current field set.
addTextareaField()  : CSOpenSearchFormTextareaField
Adds a new instance of CSOpenSearchFormTextareaField to current field set.
addTextField()  : CSOpenSearchFormTextField
Adds a new instance of CSOpenSearchFormTextField to current field set.
createCheckboxField()  : CSOpenSearchFormCheckboxField
Creates an empty form field with type: checkbox
createData()  : CSOpenSearchFormFieldData
Creates an empty data object.
createDateField()  : CSOpenSearchFormDateField
Creates a date form field with type: date
createFieldByType()  : CSOpenSearchFormField
Creates a form field for a specific type CSOpenSearchConst::FORM_FIELD_TYPE_*
createFieldData()  : CSOpenSearchFormFieldData
Creates an empty form field data object.
createInputField()  : CSOpenSearchFormField
Creates an empty form field with type: textarea
createSelectField()  : CSOpenSearchFormSelectField
Creates an empty form field with type: select
createSubSection()  : CSOpenSearchFormSubSection
Creates empty section for the form
createTextareaField()  : CSOpenSearchFormTextareaField
Creates an empty form field with type: textarea
createTextField()  : CSOpenSearchFormTextField
Creates an empty form field with type: text
getData()  : CSOpenSearchFormFieldData|array<string|int, CSOpenSearchFormFieldData>
Returns all defined CSOpenSearchFormFieldData objects as an array.
getDescription()  : string
Returns the description
getFieldByName()  : CSOpenSearchFormField|null
Returns a field by given Name.
getFields()  : array<string|int, CSOpenSearchFormField>
Returns all defined fields.
getLabel()  : mixed
Returns the name of the field.
getName()  : string
Returns the ID of the field.
getRequired()  : null|bool
Whenever the field is required
getTitle()  : string
Returns the title
getType()  : string
Returns the type of the field.
removeField()  : bool
Removes given already added field form the field set.
removeFieldByName()  : bool
Removes already added field by a Name/Id.
removeFields()  : void
Removes all defined fields
setData()  : void
Sets an array of CSOpenSearchFormFieldData objects, which holds data information.
setDescription()  : void
Sets a description.
setLabel()  : void
Sets the name of the field.
setName()  : mixed
Sets the ID of the field.
setRequired()  : void
Sets the field to required
setTitle()  : void
Sets a title.
setType()  : mixed
Defines the type of the field. One of the CSOpenSearchConst::FORM_FIELD_TYPE_* constants.
toArray()  : array<string|int, mixed>
Converts the object into an array

Methods

__construct()

Initializes the Form Section with its name

public __construct(string $sName) : mixed
Parameters
$sName : string

Unique name of the section

Tags
Return values
mixed

addFieldByType()

Adds a new instance of CSOpenSearchFormField to current field set.

public addFieldByType(string $sId, string $sType) : CSOpenSearchFormField
Parameters
$sId : string

An unique name (id) of a field within the form.

$sType : string

One of the following constants: CSOpenSearchConst::FORM_FIELD_TYPE_*

Tags
Return values
CSOpenSearchFormField

createFieldByType()

Creates a form field for a specific type CSOpenSearchConst::FORM_FIELD_TYPE_*

public createFieldByType(string $sId, string $sType) : CSOpenSearchFormField
Parameters
$sId : string

An unique name (id) of a field within the form.

$sType : string

One of the following constants: CSOpenSearchConst::FORM_FIELD_TYPE_*

Tags
Return values
CSOpenSearchFormField

createFieldData()

Creates an empty form field data object.

public createFieldData(mixed $mValue[, string $sText = null ]) : CSOpenSearchFormFieldData

It can be used to populate a field with possible data (as single object or an array)

Parameters
$mValue : mixed

A mixed value for the field

$sText : string = null

An optional text of the value (depends on the type)

Tags
Return values
CSOpenSearchFormFieldData

getDescription()

Returns the description

public getDescription() : string
Tags
Return values
string

getLabel()

Returns the name of the field.

public getLabel() : mixed
Tags
Return values
mixed

getName()

Returns the ID of the field.

public getName() : string
Tags
Return values
string

getRequired()

Whenever the field is required

public getRequired() : null|bool
Tags
Return values
null|bool

Returns null if not defined OR bool if defined.

getType()

Returns the type of the field.

public getType() : string

Can be one of the following constants CSOpenSearchConst::FORM_FIELD_TYPE_*

Tags
Return values
string

removeFieldByName()

Removes already added field by a Name/Id.

public removeFieldByName(string $sName) : bool
Parameters
$sName : string

Name/Id of the CSOpenSearchFormField.

Tags
Return values
bool

setDescription()

Sets a description.

public setDescription(string $sDescription) : void
Parameters
$sDescription : string
Tags
Return values
void

setLabel()

Sets the name of the field.

public setLabel(string $sLabel) : void
Parameters
$sLabel : string
Tags
Return values
void

setName()

Sets the ID of the field.

public setName(string $sId) : mixed
Parameters
$sId : string
Tags
Return values
mixed

setRequired()

Sets the field to required

public setRequired(bool $bIsRequired) : void
Parameters
$bIsRequired : bool
Tags
Return values
void

setTitle()

Sets a title.

public setTitle(string $sTitle) : void
Parameters
$sTitle : string
Tags
Return values
void

setType()

Defines the type of the field. One of the CSOpenSearchConst::FORM_FIELD_TYPE_* constants.

public setType(string $sType) : mixed
Parameters
$sType : string
Tags
Return values
mixed

toArray()

Converts the object into an array

public toArray() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

        

Search results