interface SectionListInterface implements Countable (View source)

Defines the interface for an object that stores layout sections.

Methods

getSections()

Gets the layout sections.

getSection(int $delta)

Gets a domain object for the layout section.

$this
appendSection(Section $section)

Appends a new section to the end of the list.

$this
insertSection(int $delta, Section $section)

Inserts a new section at a given delta.

$this
removeSection(int $delta)

Removes the section at the given delta.

$this
removeAllSections(bool $set_blank = FALSE)

Removes all of the sections.

Details

Section[] getSections()

Gets the layout sections.

Return Value

Section[]

A sequentially and numerically keyed array of section objects.

Section getSection(int $delta)

Gets a domain object for the layout section.

Parameters

int $delta

The delta of the section.

Return Value

Section

The layout section.

$this appendSection(Section $section)

Appends a new section to the end of the list.

Parameters

Section $section

The section to append.

Return Value

$this

$this insertSection(int $delta, Section $section)

Inserts a new section at a given delta.

If a section exists at the given index, the section at that position and others after it are shifted backward.

Parameters

int $delta

The delta of the section.

Section $section

The section to insert.

Return Value

$this

$this removeSection(int $delta)

Removes the section at the given delta.

As sections are stored sequentially and numerically this will re-key every subsequent section, shifting them forward.

Parameters

int $delta

The delta of the section.

Return Value

$this

$this removeAllSections(bool $set_blank = FALSE)

Removes all of the sections.

Parameters

bool $set_blank

(optional) The default implementation of section lists differentiates between a list that has never contained any sections and a list that has purposefully had all sections removed in order to remain blank. Passing TRUE will mirror ::removeSection() by tracking this as a blank list. Passing FALSE will reset the list as though it had never contained any sections at all. Defaults to FALSE.

Return Value

$this