- Symphony 2.2.1
-
› boot
9 -
› core
22 -
› email-gateways
3 -
› toolkit
66 -
› Unknown
33 - Delegates83
- Deprecated30
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
Manager FieldManager
public class FieldManager extends Manager
class.fieldmanager.php #14The FieldManager class is responsible for managing all fields types in Symphony.
Fields are stored on the file system either in the /fields
folder of TOOLKIT
or
in a fields
folder in an extension directory.
Methods
string __getClassName(
$type, $name)
Given a type, returns the full class name of a Field. Fields use a 'field' prefix
Parameters
string __getClassPath(
$type, $name)
Finds a Field by type by searching the TOOLKIT . /fields
folder and then
any fields folders in the installed extensions. The function returns
the path to the folder where the field class resides.
Parameters
string __getDriverPath(
$type, $name)
Given a field type, return the path to it's class
Parameters
See Also
string __getHandleFromFilename(
$filename)
Given the filename of a Field, return it's handle. This will remove
the Symphony conventions of field.*.php
Parameters
integer|boolean add(
$fields)
Given an associative array of fields, insert them into the database returning the resulting Field ID if successful, or false if there was an error. As fields are saved in order on a section, a query is made to determine the sort order of this field to be current sort order +1.
Parameters
Returns
Returns a Field ID of the created Field on success, false otherwise.
Field create(
$type, $name)
Creates an instance of a given class and returns it. Adds the instance
to the $_pool
array with the key being the handle.
Parameters
boolean delete(
$id)
Given a Field ID, delete a Field from Symphony. This will remove the field from
the fields table, all of the data stored in this field's tbl_entries_data_$id
any
existing section associations. This function additionally call the Field's tearDown
method so that it can cleanup any additional settings or entry tables it may of created.
Parameters
boolean edit(
$id, $fields)
Given a Field ID and associative array of fields, update an existing Field
row in the tbl_fields
table. Returns boolean for success/failure
Parameters
array fetch(
$id, $section_id, $order, $sortfield, $type, $location, $where, $restrict)
The fetch method returns a instance of a Field from tbl_fields. The most common use of this function is to retrieve a Field by ID, but it can be used to retrieve Fields from a Section also. There are several parameters that can be used to fetch fields by their Type, Location, by a Field Constant or with a custom WHERE query.
Parameters
Returns
An array of Field objects. If no Field are found, null is returned.
integer fetchFieldIDFromElementName(
$element_name, $section_id)
Given an element name and it's section, return it's ID. Symphony enforces a uniqueness constraint on a section where every field must have a unique label (and therefore handle) so whilst it is impossible to have two fields from the same section, it would be possible to have two fields with the same name from different sections. Passing the $section_id allows you to specify which section should be searched.
Parameters
Returns
The field ID
string fetchFieldTypeFromID(
$id)
Given a field ID, return the type of the field by querying tbl_fields
void fetchHandleFromElementName(
$id)
Deprecated
This function will be removed in the next major release. The FieldManager::fetchHandleFromID
is the preferred way to get a field's handle
string fetchHandleFromID(
$id)
Given a field ID, return the handle of the field by querying tbl_fields
array fetchTypes()
Returns an array of all available field handles discovered in the
TOOLKIT . /fields
or EXTENSIONS . /{}/fields
.
Returns
A single dimensional array of field handles.