eZ\Publish\Core\Repository\SectionService::loadSections PHP Method

loadSections() public method

Loads all sections.
public loadSections ( ) : eZ\Publish\API\Repository\Values\Content\Section[]
return eZ\Publish\API\Repository\Values\Content\Section[]
    public function loadSections()
    {
        if ($this->repository->hasAccess('section', 'view') !== true) {
            throw new UnauthorizedException('section', 'view');
        }
        $spiSections = $this->sectionHandler->loadAll();
        $sections = array();
        foreach ($spiSections as $spiSection) {
            $sections[] = $this->buildDomainSectionObject($spiSection);
        }
        return $sections;
    }