Templating
Global Functions
Website
\Components\Website\Designs \Components\Website\Pages \Components\Website\Pages\Forms \Components\Website\Posts \Components\Website\Posts\Categories
Customers
\Components\Customers\Contacts \Components\Customers\Contacts\Relationships \Components\Customers\Contacts\Relationships\Types \Components\Customers\Groups
Marketing
\Components\Marketing\EmailMarketing \Components\Marketing\Events \Components\Marketing\Events\Attendees \Components\Marketing\Events\Locations
Commerce
\Components\Commerce\Carts \Components\Commerce\Carts\Current \Components\Commerce\Configuration\PaymentMethods \Components\Commerce\Configuration\ShippingMethods \Components\Commerce\Discounts \Components\Commerce\Products \Components\Commerce\Products\Brands \Components\Commerce\Products\Categories \Components\Commerce\Products\Inventory \Components\Commerce\Sales \Components\Commerce\Sales\Items \Components\Commerce\Sales\Receipts \Components\Commerce\Sales\Receipts\Allocations
Settings
\Components\Settings\Administrators \Components\Settings\CustomFields \Components\Settings\Domains
Other Apps
\Components\Website\Comments \Components\Commerce\Affiliates \Components\Commerce\Affiliates\Administrators \Components\Commerce\Affiliates\Commissions \Components\Commerce\Affiliates\Payments \Components\Commerce\RecurringSales \Components\Commerce\RecurringSales\StoredCards
Framework
\Framework\Caching \Framework\Data\Util \Framework\HTML\Converters \Framework\HTTP\Cookies \Framework\HTTP\Redirection \Framework\HTTP\Request \Framework\HTTP\Session \Framework\HTTP\UserAgent \Framework\I18N\CompanyTypes \Framework\I18N\Countries \Framework\I18N\Languages \Framework\Network\GeoIP
Methods

\Components\Settings\CustomFields::

Methods

Invoke via \Components\Settings\CustomFields::method()
Click a method name to copy it.
array get($iCustomFieldId)
Gets a record from the database
Parameters
$iCustomFieldId
int
A record's custom_field_id
Return
array getAll($arrQuery)
Return a set of records from the database
Parameters
$arrQuery
array|null
Return
Array of CustomFields
array|null getByComponentAndField($strComponent, $strField)
Returns a custom field from its component and field name
Parameters
$strComponent
string
$strField
string
Return
array|null
mixed getColumn($iCustomFieldId, $strColumn)
Gets a single field from a record
Parameters
$iCustomFieldId
int
A record's custom_field_id
$strColumn
string
Return
mixed
int getCount($arrFilter)
Returns the number of records in the database (matching the filter if specified)
Parameters
$arrFilter
array|null
Return
int
string|null getForm($strComponent, $strField)
Returns the form for a custom field
Parameters
$strComponent
string
$strField
string
Return
string|null
array|null getOptions($strComponent, $strField)
If the custom field contains options, return them as an array
Parameters
$strComponent
string
$strField
string
Return
array|null
int save($arrEntity)
Saves a record into the database
Parameters
$arrEntity
array
Return
The record's custom_field_id
void saveColumn($iCustomFieldId, $strColumn, $strValue)
Saves a specific column of a row into a database
Parameters
$iCustomFieldId
int
A record's custom_field_id
$strColumn
string
$strValue
string
array search($strSearch, $arrQuery)
Performs a search
Parameters
$strSearch
string
Search query
$arrQuery
array|null
Return
Array of CustomFields that match the search query.
string uniquifyDataColumns($strForm, $strSuffix)
Suffix all datacolumn's in the supplied form with the supplied string, allowing the custom field form to be unique when included in certain contexts such as
Automation conditions.
Parameters
$strForm
string
The form to uniquify.
$strSuffix
string
The string to append to all form datacolumn's.
Return
The uniquified form.
string uniquifyIDs($strForm, $strSuffix)
Suffix all id's in the supplied form with the supplied Id, allowing the custom field form to be unique when included in certain contexts such as
Automation conditions.
Parameters
$strForm
string
The form to uniquify.
$strSuffix
string
The string to append to all form id's.
Return
The uniquified form.
bool delete($iCustomFieldId, $bDeleteMedia)
Deletes a record from the database
Parameters
$iCustomFieldId
int
A record's custom_field_id
$bDeleteMedia
bool
Return
Returns true if record existed and was deleted, otherwise false

Database Fields

The following fields are used when retrieving and saving entities.
custom_field_id
int (11)
custom_field_component
string (255)
custom_field_table
string (255)
custom_field_is_editable
0 or 1
Default value: 1
field_id
string (255)
field_label
string (255)
field_description
string (255)
field_type
string (255)
field_type_options
string (65535)
field_form
string (65535)
field_is_mandatory
0 or 1
field_is_searchable
0 or 1
field_is_public
0 or 1
field_is_shown_in_lists
0 or 1
field_is_shown_in_checkout
0 or 1
field_is_shown_in_manual_sales
0 or 1
field_display
string (65535)
field_order
int unsigned