class Field

This class allows the storage and retrieval of the attributes of a field.

A field is an element of the page displayed on the browser in which a data is entered or restituted. A field is therefore always linked to a data item.

In G6K, a field is always contained in a field set.

Properties

private FieldSet $fieldset
private int $position
private bool $newline
private int $data
private string $label
private string $usage
private string $prompt
private bool $required
private bool $visibleRequired
private bool $colon
private bool $underlabel
private bool $help
private bool $emphasize
private string $explanation
private string $widget
private bool $expanded
private FieldNote $preNote
private FieldNote $postNote
private bool $displayable

Methods

void
__construct(FieldSet $fieldset, int $position, int $data, string $label)

Constructor of class Field

getFieldSet()

Returns the FieldSet object that contains this field

int
getPosition()

Returns the position of this field in the field set.

void
setPosition(int $position)

Sets the position of this field in the field set.

bool
isNewline()

Returns the newline attribute of this Field object

bool
getNewline()

Returns the newline attribute of this Field object

void
setNewline(bool $newline)

Determines whether the display of this field and its label should start on a new line or not.

int
getData()

Returns the ID of the data item displayed or fed by this field.

void
setData(int $data)

Sets the ID of the data item displayed or fed by this field.

string
getLabel()

Returns the label of this field.

void
setLabel(string $label)

Sets the label of this field.

string
getUsage()

Returns the usage of this field.

void
setUsage(string $usage)

Sets the usage of this field.

string
getPrompt()

Returns the text to appear in the list box when no item is selected.

void
setPrompt(string $prompt)

Sets the text to appear in the list box when no item is selected.

bool
isRequired()

Returns the required attribute of this field.

bool
getRequired()

Returns the required attribute of this field.

void
setRequired(bool $required)

Determines whether the field entry is mandatory or not.

bool
isVisibleRequired()

Returns the required attribute of this field when displayed.

bool
getVisibleRequired()

Returns the required attribute of this field when displayed.

void
setVisibleRequired(bool $visibleRequired)

Determines whether the field entry is mandatory or not when displayed.

bool
hasColon()

Returns the colon attribute of this field.

bool
getColon()

Returns the colon attribute of this field.

void
setColon(bool $colon)

Determines whether a colon should be displayed after the label of this field.

bool
isUnderlabel()

Returns the underlabel attribute of this field.

bool
getUnderlabel()

Returns the underlabel attribute of this field.

void
setUnderlabel(bool $underlabel)

Determines whether the field should be displayed below its label and not to its right.

bool
hasHelp()

Returns the help attribute of this field.

bool
getHelp()

Returns the help attribute of this field.

void
setHelp(bool $help)

Determines whether the description of the data linked to this field should be displayed as help text

bool
isEmphasized()

Returns the emphasize attribute of this field.

bool
getEmphasize()

Returns the emphasize attribute of this field.

void
setEmphasize(bool $emphasize)

Determines whether the label of the field should be emphasized or not.

string
getExplanation()

Returns the text explaining to the user how the field value was calculated.

void
setExplanation(string $explanation)

Sets a text explaining to the user how the field value was calculated.

bool
isExpanded()

Returns the expanded attribute of this field.

bool
getExpanded()

Returns the expanded attribute of this field.

void
setExpanded(bool $expanded)

Detrmines whether all the elements of a list of choices must be visible or not.

string
getWidget()

Returns the name of the widget associated with this field.

void
setWidget(string $widget)

Sets the name of the widget associated with this field.

getPreNote()

Returns the note associated with this field that is displayed above the field.

void
setPreNote(FieldNote $preNote)

Sets the note associated with this field that should be displayed above the field.

getPostNote()

Returns the note associated with this field that is displayed below the field.

void
setPostNote(FieldNote $postNote)

Sets the note associated with this field that should be displayed below the field.

bool
isDisplayable()

Returns the displayable attribute of this Field object

bool
getDisplayable()

Returns the displayable attribute of this Field object

void
setDisplayable(bool $displayable)

Determines whether this field can be displayed or not

string
getClass()

Returns the class name of this Field object

Details

at line 205
void __construct(FieldSet $fieldset, int $position, int $data, string $label)

Constructor of class Field

Parameters

FieldSet $fieldset The FieldSet object that contains this field.
int $position The position of this field in the field set.
int $data The ID of the data item displayed or fed by this field.
string $label The label of this field.

Return Value

void

at line 219
FieldSet getFieldSet()

Returns the FieldSet object that contains this field

Return Value

FieldSet The FieldSet object

at line 230
int getPosition()

Returns the position of this field in the field set.

Return Value

int The position of this field.

at line 242
void setPosition(int $position)

Sets the position of this field in the field set.

Parameters

int $position The position of this field.

Return Value

void

at line 255
bool isNewline()

Returns the newline attribute of this Field object

If true, the class 'newline' is added to HTML container of the field. A css rule can therefore be used to place this field on a new line.

Return Value

bool true if the display of this field and its label should start on a new line,false otherwise

at line 268
bool getNewline()

Returns the newline attribute of this Field object

If true, the class 'newline' is added to HTML container of the field. A css rule can therefore be used to place this field on a new line.

Return Value

bool true if the display of this field and its label should start on a new line,false otherwise

at line 282
void setNewline(bool $newline)

Determines whether the display of this field and its label should start on a new line or not.

If true, the class 'newline' is added to HTML container of the field. A css rule can therefore be used to place this field on a new line.

Parameters

bool $newline true if the display of this field and its label should start on a new line,false otherwise

Return Value

void

at line 293
int getData()

Returns the ID of the data item displayed or fed by this field.

Return Value

int The ID of the data item.

at line 305
void setData(int $data)

Sets the ID of the data item displayed or fed by this field.

Parameters

int $data The ID of the data item.

Return Value

void

at line 316
string getLabel()

Returns the label of this field.

Return Value

string The label of this field

at line 328
void setLabel(string $label)

Sets the label of this field.

Parameters

string $label The label of this field

Return Value

void

at line 339
string getUsage()

Returns the usage of this field.

Return Value

string The usage of this field

at line 355
void setUsage(string $usage)

Sets the usage of this field.

if usage is "input", the user can enter a value in the field that will be assigned to the data related to this field

if usage is "output", the value of the related data item is displayed as static field.

Parameters

string $usage The usage of this field

Return Value

void

at line 368
string getPrompt()

Returns the text to appear in the list box when no item is selected.

This text applies only to an associated data of type "choice" or "multichoice" whose field is displayed as a list box (expanded = false).

Return Value

string The text to appear in the list box

at line 382
void setPrompt(string $prompt)

Sets the text to appear in the list box when no item is selected.

This text applies only to an associated data of type "choice" or "multichoice" whose field is displayed as a list box (expanded = false).

Parameters

string $prompt The text to appear in the list box

Return Value

void

at line 393
bool isRequired()

Returns the required attribute of this field.

Return Value

bool true if the field entry is manadatory, false otherwise

at line 404
bool getRequired()

Returns the required attribute of this field.

Return Value

bool true if the field entry is manadatory, false otherwise

at line 416
void setRequired(bool $required)

Determines whether the field entry is mandatory or not.

Parameters

bool $required true if the field entry is manadatory, false otherwise

Return Value

void

at line 427
bool isVisibleRequired()

Returns the required attribute of this field when displayed.

Return Value

bool true if the field entry is manadatory when displayed, false otherwise

at line 438
bool getVisibleRequired()

Returns the required attribute of this field when displayed.

Return Value

bool true if the field entry is manadatory when displayed, false otherwise

at line 450
void setVisibleRequired(bool $visibleRequired)

Determines whether the field entry is mandatory or not when displayed.

Parameters

bool $visibleRequired true if the field entry is manadatory when displayed, false otherwise

Return Value

void

at line 461
bool hasColon()

Returns the colon attribute of this field.

Return Value

bool true if a colon should be displayed after the label, false otherwise

at line 472
bool getColon()

Returns the colon attribute of this field.

Return Value

bool true if a colon should be displayed after the label, false otherwise

at line 484
void setColon(bool $colon)

Determines whether a colon should be displayed after the label of this field.

Parameters

bool $colon true if a colon should be displayed after the label, false otherwise

Return Value

void

at line 497
bool isUnderlabel()

Returns the underlabel attribute of this field.

If true, the class 'underlabel' is added to HTML container of the field. A css rule can therefore be used to place this field under its label on a new line.

Return Value

bool true if the field is displayed below its label, false otherwise

at line 510
bool getUnderlabel()

Returns the underlabel attribute of this field.

If true, the class 'underlabel' is added to HTML container of the field. A css rule can therefore be used to place this field below its label on a new line.

Return Value

bool true if the field is displayed below its label, false otherwise

at line 524
void setUnderlabel(bool $underlabel)

Determines whether the field should be displayed below its label and not to its right.

If true, the class 'underlabel' is added to HTML container of the field. A css rule can therefore be used to place this field below its label on a new line.

Parameters

bool $underlabel true if the field should be displayed below its label, false otherwise

Return Value

void

at line 537
bool hasHelp()

Returns the help attribute of this field.

If the value is true, the description of the data is displayed in a foldable area below the field, visible after the user clicks on an icon.

Return Value

bool true if the description of the data will be displayed as help text, false otherwise

at line 550
bool getHelp()

Returns the help attribute of this field.

If the value is true, the description of the data is displayed in a foldable area below the field, visible after the user clicks on an icon.

Return Value

bool true if the description of the data will be displayed as help text, false otherwise

at line 564
void setHelp(bool $help)

Determines whether the description of the data linked to this field should be displayed as help text

If the value is true, the description of the data is displayed in a foldable area below the field, visible after the user clicks on an icon.

Parameters

bool $help true if the description of the data will be displayed as help text, false otherwise

Return Value

void

at line 577
bool isEmphasized()

Returns the emphasize attribute of this field.

If true, the class 'emphasized' is added to HTML container of the label. A css rule can therefore be used to emphasize (highlight) the label.

Return Value

bool true if the label of the field is emphasized, false otherwise

at line 590
bool getEmphasize()

Returns the emphasize attribute of this field.

If true, the class 'emphasized' is added to HTML container of the label. A css rule can therefore be used to emphasize (highlight) the label.

Return Value

bool true if the label of the field is emphasized, false otherwise

at line 604
void setEmphasize(bool $emphasize)

Determines whether the label of the field should be emphasized or not.

If true, the class 'emphasized' is added to HTML container of the label. A css rule can therefore be used to emphasize (highlight) the label.

Parameters

bool $emphasize true if the label of the field should be emphasized, false otherwise

Return Value

void

at line 615
string getExplanation()

Returns the text explaining to the user how the field value was calculated.

Return Value

string The explanatory text

at line 627
void setExplanation(string $explanation)

Sets a text explaining to the user how the field value was calculated.

Parameters

string $explanation The explanatory text

Return Value

void

at line 640
bool isExpanded()

Returns the expanded attribute of this field.

if true, radio buttons are displayed instead of a list box if it is a data of type 'choice' or checkboxes if it is a data of type 'multichoice'

Return Value

bool the value of expanded

at line 653
bool getExpanded()

Returns the expanded attribute of this field.

if true, radio buttons are displayed instead of a list box if it is a data of type 'choice' or checkboxes if it is a data of type 'multichoice'

Return Value

bool the value of expanded

at line 667
void setExpanded(bool $expanded)

Detrmines whether all the elements of a list of choices must be visible or not.

if true, radio buttons are displayed instead of a list box if it is a data of type 'choice' or checkboxes if it is a data of type 'multichoice'

Parameters

bool $expanded

Return Value

void

at line 682
string getWidget()

Returns the name of the widget associated with this field.

A widget is a small Javascript component to make it easier to enter a field.

Read the file src/EUREKA/G6KBundle/Resources/config/parameters.yml to see the list of available widgets and their definition.

Return Value

string The name of the widget.

at line 698
void setWidget(string $widget)

Sets the name of the widget associated with this field.

A widget is a small Javascript component to make it easier to enter a field.

Read the file src/EUREKA/G6KBundle/Resources/config/parameters.yml to see the list of available widgets and their definition.

Parameters

string $widget The name of the widget.

Return Value

void

at line 709
FieldNote getPreNote()

Returns the note associated with this field that is displayed above the field.

Return Value

FieldNote The note displayed above this field

at line 721
void setPreNote(FieldNote $preNote)

Sets the note associated with this field that should be displayed above the field.

Parameters

FieldNote $preNote The note that should be displayed above this field

Return Value

void

at line 732
FieldNote getPostNote()

Returns the note associated with this field that is displayed below the field.

Return Value

FieldNote The note displayed below this field

at line 744
void setPostNote(FieldNote $postNote)

Sets the note associated with this field that should be displayed below the field.

Parameters

FieldNote $postNote The note that should be displayed below this field

Return Value

void

at line 755
bool isDisplayable()

Returns the displayable attribute of this Field object

Return Value

bool true if this field can be displayed, false otherwise

at line 766
bool getDisplayable()

Returns the displayable attribute of this Field object

Return Value

bool true if this field can be displayed, false otherwise

at line 778
void setDisplayable(bool $displayable)

Determines whether this field can be displayed or not

Parameters

bool $displayable true if this field can be displayed, false otherwise

Return Value

void

at line 789
string getClass()

Returns the class name of this Field object

Return Value

string The class name