- Symphony 2.7.0
-
› assets
14 -
› boot
15 -
› core
24 -
› cryptography
4 -
› data-sources
6 -
› email-gateways
3 -
› events
3 -
› global
61 -
› interface
9 -
› toolkit
60 - Delegates101
- Deprecated28
Versions
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.3
- 2.7.2
- 2.7.10
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.11
- 2.6.10
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
Options
Field FieldCheckbox
public class FieldCheckbox extends Field
field.checkbox.php #11Checkbox field simulates a HTML checkbox field, in that it represents a simple yes/no field.
Methods
void __construct()
Construct a new instance of this field.
boolean allowDatasourceOutputGrouping()
Test whether this field supports data-source output grouping. This default implementation prohibits grouping. Data-source grouping allows clients of this field to group the XML output according to this field. Subclasses should override this if grouping is supported.
Returns
true if this field does support data-source grouping, false otherwise.
boolean allowDatasourceParamOutput()
Test whether this field supports data-source parameter output. This default implementation prohibits parameter output. Data-source parameter output allows this field to be provided as a parameter to other data-sources or XSLT. Subclasses should override this if parameter output is supported.
Returns
true if this supports data-source parameter output, false otherwise.
void appendFormattedElement(XMLElement $wrapper, $data, $encode, $mode, $entry_id)
Append the formatted XML output of this field as utilized as a data source.
Since Symphony 2.5.0, it will defaults to prepareReadableValue
return value.
Parameters
boolean buildDSRetrievalSQL(
$data, $joins, $where, $andOperation)
Construct the SQL statement fragments to use to retrieve the data of this field when utilized as a data source.
Parameters
Returns
true if the construction of the SQL was successful, false otherwise.
See Also
void buildSortingSQL(
$joins, $where, $sort, $order)
Build the SQL command to append to the default query to enable sorting of this field. By default this will sort the results by the entry id in ascending order.
Extension developers should always implement both buildSortingSQL()
and buildSortingSelectSQL()
.
Uses
Parameters
See Also
string buildSortingSelectSQL(
$sort, $order)
Build the needed SQL clause command to make buildSortingSQL()
work on
MySQL 5.7 in strict mode, which requires all columns in the ORDER BY
clause to be included in the SELECT's projection.
If no new projection is needed (like if the order is made via a sub-query), simply return null.
For backward compatibility, this method checks if the sort expression
contains ed
.value
. This check will be removed in Symphony 3.0.0.
Extension developers should make their Fields implement
buildSortingSelectSQL()
when overriding buildSortingSQL()
.
Uses
Parameters
Returns
an optional select clause to append to the generated SQL query. This is needed when sorting on a column that is not part of the projection.
See Also
boolean canFilter()
Test whether this field can be filtered. This default implementation prohibits filtering. Filtering allows the XML output results to be limited according to an input parameter. Subclasses should override this if filtering is supported.
Returns
true if this can be filtered, false otherwise.
boolean canToggle()
Test whether this field can be toggled using the With Selected menu on the Publish Index.
Returns
true if it can be toggled, false otherwise.
integer checkPostFieldData(
$data, $message, $entry_id)
Check the field data that has been posted from a form. This will set the input message to the error message or to null if there is none. Any existing message value will be overwritten.
Parameters
Returns
self::__MISSING_FIELDS__
if there are any missing required fields, self::__OK__
otherwise.
boolean commit()
Commit the settings of this field from the section editor to create an instance of this field in a section.
Returns
true if the commit was successful, false otherwise.
boolean createTable()
The default field table construction method. This constructs the bare minimum set of columns for a valid field table. Subclasses are expected to overload this method to create a table structure that contains additional columns to store the specific data created by the field.
See Also
void displayFilteringOptions(XMLElement $wrapper)
Inserts tags at the bottom of the filter panel
void displayPublishPanel(XMLElement $wrapper, $data, $flagWithError, $fieldnamePrefix, $fieldnamePostfix, $entry_id)
Display the publish panel for this field. The display panel is the
interface shown to Authors that allow them to input data into this
field for an Entry
.
Parameters
void displaySettingsPanel(XMLElement $wrapper, $errors)
Display the default settings panel, calls the buildSummaryBlock
function after basic field settings are added to the wrapper.
Parameters
See Also
array fetchFilterableOperators()
Returns the keywords that this field supports for filtering. Note that no filter will do a simple 'straight' match on the value.
array fetchSuggestionTypes()
Returns the types of filter suggestion this field supports. The array may contain the following values:
entry
for searching entries in the current sectionassociation
for searching entries in associated sectionsstatic
for searching static valuesdate
for searching in a calendarparameters
for searching in parametersIf the date type is set, only the calendar will be shown in the suggestion dropdown.
void findDefaults(
$settings)
Allows a field to set default settings.
Parameters
XMLElement getExampleFormMarkup()
The default method for constructing the example form markup containing this
field when utilized as part of an event. This displays in the event documentation
and serves as a basic guide for how markup should be constructed on the
Frontend
to save this field
Returns
a label widget containing the formatted field element name of this.
array getExportModes()
Return a list of supported export modes for use with prepareExportValue
.
void getImportModes()
string|array getParameterPoolValue(
$data, $entry_id)
Function to format this field if it chosen in a data-source to be output as a parameter in the XML.
Since Symphony 2.5.0, it will defaults to prepareReadableValue
return value.
Parameters
Returns
The formatted value to be used as the parameter. Note that this can be an array or a string. When returning multiple values use array, otherwise use string.
array getToggleStates()
Accessor to the toggle states. This default implementation returns an empty array.
Returns
the array of toggle states.
void groupRecords(
$records)
Default implementation of record grouping. This default implementation
will throw an Exception
. Thus, clients must overload this method
for grouping to be successful.
Parameters
boolean isSortable()
Test whether this field can be sorted. This default implementation returns false.
Returns
true if this field is sortable, false otherwise.
string|boolean|null prepareExportValue(
$data, $mode, $entry_id)
Give the field some data and ask it to return a value using one of many possible modes.
void prepareImportValue(
$data, $mode, $entry_id)
string prepareTextValue(
$data, $entry_id)
Format this field value for complete display as text (string). By default, it looks for the 'value' key in the $data array and strip tags from it.
Parameters
Returns
the complete text representation of the values of this field instance.
array processRawFieldData(
$data, $status, $message, $simulate, $entry_id)
Process the raw field data.
Parameters
Returns
the processed field data.
array toggleFieldData(
$data, $newState, $entry_id)
Toggle the field data. This default implementation always returns the input data.
Parameters
Returns
the toggled data.