- Symphony 2.6.6
-
› assets
14 -
› boot
14 -
› core
23 -
› cryptography
4 -
› data-sources
6 -
› email-gateways
3 -
› events
3 -
› global
59 -
› interface
9 -
› toolkit
59 - Delegates92
- Deprecated27
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
public class Entry
class.entry.php #14An entry is a combination of data that is stored in several Fields typically contained in one Section. Entries are created by the Authors of Symphony and hold all the content for the website. Entries are typically created from the Symphony backend, but can also be created using Events from the Frontend.
Properties
string $creationDate
An ISO 8601 representation of when this Entry was created
eg. 2004-02-12T15:19:21+00:00
Deprecated
Since Symphony 2.3.1, use $entry->get('creation_date') instead. This variable will be removed in Symphony 3.0
Methods
integer assignEntryId()
Creates the initial entry row in tbl_entries and returns the resulting
Entry ID using getInsertID()
.
See Also
integer checkPostData(
$data, $errors, $ignore_missing_fields)
Given a array of data from a form, this function will iterate over all the fields
in this Entry's Section and call their checkPostFieldData()
function.
Parameters
Returns
Either Entry::__ENTRY_OK__
or Entry::__ENTRY_FIELD_ERROR__
boolean commit()
Commits this Entry's data to the database, by first finding the default
data for this Entry
and then utilising the EntryManager
's
add or edit function. The EntryManager::edit
function is used if
the current Entry
object has an ID, otherwise EntryManager::add
is used.
Returns
true if the commit was successful, false otherwise.
See Also
array fetchAllAssociatedEntryCounts(
$associated_sections)
Entries may link to other Entries through fields. This function will return the number of entries that are associated with the current entry as an associative array. If there are no associated entries, null will be returned.
Parameters
Returns
An associative array with the key being the associated Section's ID and the value being the number of entries associated with this Entry.
void findDefaultData()
Iterates over all the Fields in this Entry calling their
processRawFieldData()
function to set default values for this Entry.
See Also
null|mixed|array get(
$setting)
Accessor to the a setting by name. If no setting is provided all the settings of this Entry instance are returned.
Parameters
Returns
the value of the setting if there is one, all settings if the input setting was omitted or null if the setting was supplied but there is no value for that setting.
array|object getData(
$field_id, $asObject)
Accessor function to return data from this Entry for a particular field. Optional parameter to return this data as an object instead of an array. If a Field is not provided, an associative array of all data assigned to this Entry will be returned.
Parameters
Returns
Depending on the value of $asObject
, return the field's data as either an array or an object. If no data exists, null will be returned.
void set(
$setting, $value)
Entries have some basic metadata settings such as the Entry ID, the Author ID who created it and the Section that the Entry sits in. This function will set a setting to a value overwriting any existing value for this setting
Parameters
void setData(
$field_id, $data)
Set the data for a Field in this Entry, given the Field ID and it's data
Parameters
integer setDataFromPost(
$data, $errors, $simulate, $ignore_missing_fields)
When an entry is saved from a form (either Frontend/Backend) this
function will find all the fields in this set and loop over them, setting
the data to each of the fields for processing. If any errors occur during
this, _ENTRY_FIELD_ERROR_
is returned, and an array is available with
the errors.
Parameters
Returns
Either Entry::__ENTRY_OK__
or Entry::__ENTRY_FIELD_ERROR__