trait SectionListTrait (View source)

Provides a trait for maintaining a list of sections.

Methods

$this
setSections(array $sections)

Stores the information for all sections.

count()

{@inheritdoc}

getSection($delta)

{@inheritdoc}

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

Sets the section for the given delta on the display.

appendSection(Section $section)

{@inheritdoc}

insertSection($delta, Section $section)

{@inheritdoc}

$this
addBlankSection()

Adds a blank section to the list.

bool
hasBlankSection()

Indicates if this section list contains a blank section.

removeSection($delta)

{@inheritdoc}

removeAllSections($set_blank = FALSE)

{@inheritdoc}

bool
hasSection(int $delta)

Indicates if there is a section at the specified delta.

__clone()

Magic method: Implements a deep clone.

Details

abstract protected $this setSections(array $sections)

Stores the information for all sections.

Implementations of this method are expected to call array_values() to rekey the list of sections.

Parameters

array $sections

An array of section objects.

Return Value

$this

count()

{@inheritdoc}

getSection($delta)

{@inheritdoc}

Parameters

$delta

protected $this setSection(int $delta, Section $section)

Sets the section for the given delta on the display.

Parameters

int $delta

The delta of the section.

Section $section

The layout section.

Return Value

$this

appendSection(Section $section)

{@inheritdoc}

Parameters

Section $section

insertSection($delta, Section $section)

{@inheritdoc}

Parameters

$delta
Section $section

protected $this addBlankSection()

Adds a blank section to the list.

Return Value

$this

See also

BlankLayout

protected bool hasBlankSection()

Indicates if this section list contains a blank section.

A blank section is used to differentiate the difference between a layout that has never been instantiated and one that has purposefully had all sections removed.

Return Value

bool

TRUE if the section list contains a blank section, FALSE otherwise.

See also

BlankLayout

removeSection($delta)

{@inheritdoc}

Parameters

$delta

removeAllSections($set_blank = FALSE)

{@inheritdoc}

Parameters

$set_blank

protected bool hasSection(int $delta)

Indicates if there is a section at the specified delta.

Parameters

int $delta

The delta of the section.

Return Value

bool

TRUE if there is a section for this delta, FALSE otherwise.

__clone()

Magic method: Implements a deep clone.