public class SectionManager

class.sectionmanager.php #13

The SectionManager is responsible for managing all Sections in a Symphony installation. The SectionManager contains basic CRUD operations for Sections. Sections are stored in the database in tbl_sections.

Properties

mixed $_Parent

The parent class who initialised the SectionManager, usually a Symphony instance, either Frontend or Administration

Methods

void __construct(mixed $parent)

The construct function sets the parent variable of the SectionManager

Parameters
  • $parent mixedThe class that initialised this Section, usually SectionManager

integer add(array $settings)

Takes an associative array of Section settings and creates a new entry in the tbl_sections table, returning the ID of the Section. The ID of the section is generated using auto_increment

Parameters
  • $settings arrayAn associative of settings for a section with the key being a column name from tbl_sections

Section create()

Returns a new Section object, using the SectionManager as the Section's $parent.

void delete(integer $section_id)

Deletes a Section by Section ID, removing all entries, fields, the Section and then any Section Associations in that order

Parameters
  • $section_id integerThe ID of the Section to delete

boolean edit(integer $section_id, array $settings)

Updates an existing Section given it's ID and an associative array of settings. The array does not have to contain all the settings for the Section as there is no deletion of settings prior to updating the Section

Parameters
  • $section_id integerThe ID of the Section to update

  • $settings arrayAn associative of settings for a section with the key being a column name from tbl_sections

Section|array fetch(integer $section_id, string $order, string $sortfield)

Returns a Section object by ID, or returns an array of Sections if the Section ID was omitted. If the Section ID is omitted, it is possible to sort the Sections by providing a sort order and sort field. By default, Sections will be order in ascending order by their name

Parameters
  • $section_id integerThe ID of the section to return. Defaults to null

  • $order stringIf $section_id is omitted, this is the sortorder of the returned objects. Defaults to ASC, other options id DESC

  • $sortfield stringThe name of the column in the tbl_sections table to sort on. Defaults to name

Returns

A Section object or an array of Section objects

integer fetchIDFromHandle(string $handle)

Return a Section ID by the handle

Parameters
  • $handle stringThe handle of the section

Returns

The Section ID

void flush()

This function will empty the $_pool array.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details