- 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
public class EntryManager
class.entrymanager.php #19The EntryManager is responsible for all Entry objects in Symphony.
Entries are stored in the database in a cluster of tables. There is a
parent entry row stored in tbl_entries
and then each field's data is
stored in a separate table, tbl_entries_data_{field_id}
. Where Field ID
is generated when the Section is saved. This Manager provides basic
add, edit, delete and fetching methods for Entries.
Properties
FieldManager $fieldManager
An instance of the FieldManager
TextFormatterManager $formatterManager
An instance of the TextFormatterManager
SectionManager $sectionManager
An instance of the SectionManager
Methods
array __buildEntries(
$rows, $section_id, $element_names)
Given an array of Entry data from tbl_entries
and a section ID, return an
array of Entry objects. For performance reasons, it's possible to pass an array
of field handles via $element_names
, so that only a subset of the section schema
will be queried. This function currently only supports Entry from one section at a
time.
Parameters
void __construct(Administration $parent)
The constructor initialises the formatterManager, sectionManager and
fieldManager variables and sets the $this->_Parent
to the param provided.
Parameters
boolean add(Entry $entry)
Given an Entry object, iterate over all of the fields in that object an insert them into their relevant entry tables.
Parameters
Entry create()
Creates a new Entry object using this class as the parent.
void delete(
$entries)
Given an Entry object, or an array of Entry objects delete all
data associated with this Entry using a Field's entryDataCleanup()
function, and then remove this Entry from tbl_entries
.
Parameters
void fetch(
$entry_id, $section_id, $limit, $start, $where, $joins, $group, $buildentries, $element_names, $records_only)
This function will return an array of Entry objects given an ID or an array of ID's.
Do not provide $entry_id
as an array if not specifying the $section_id
. This function
is commonly passed custom SQL statements through the $where
and $join
parameters
that is generated by the fields of this section
Parameters
array fetchByPage(
$page, $section_id, $entriesPerPage, $where, $joins, $group, $records_only, $buildentries, $element_names)
Returns an array of Entry objects, with some basic pagination given the number of Entry's to return and the current starting offset. This function in turn calls the fetch function that does alot of the heavy lifting. For instance, if there are 60 entries in a section and the pagination dictates that per page, 15 entries are to be returned, by passing 2 to the $page parameter you could return entries 15-30
Parameters
Returns
Either an array of Entry objects, or an associative array containing the total entries, the start position, the entries per page and the Entry objects
integer fetchCount(
$section_id, $where, $joins, $group)
Return the count of the number of entries in a particular section.
Parameters
integer fetchEntrySectionID(
$entry_id)
Given an Entry ID, return the Section ID that it belongs to
Parameters
Returns
The Section ID for this Entry's section
StdClass getFetchSorting()
Returns an object representation of the sorting for the EntryManager, with the field and direction provided
void setFetchSorting(
$field_id, $direction)
Convenience function that will set sorting field and direction
by calling setFetchSortingField()
& setFetchSortingDirection()
Parameters
See Also
void setFetchSortingDirection(
$direction)
Setter function for the default sorting direction of the Fetch function. Available options are RAND, ASC or DESC.
Parameters
void setFetchSortingField(
$field_id)
Sets the field to applying the sorting direction on when fetching entries