src/Page/Page.php
public function addSections(array $sections): PageInterface
    {
        $sections = array_merge(
            $this->repository()->getSections()->all(),
            $sections
        );

        array_walk($sections, function ($section) {
            // Set a default view to each section if none defined.
            /** @var SectionInterface $section */
            if (empty($section->getView())) {
                $section->setView('section');
            }
        });

        $this->repository()->setSections($sections);

        return $this;
    }
public function addSections(array $sections): PageInterface
    {
        $sections = array_merge(
            $this->repository()->getSections()->all(),
            $sections
        );

        array_walk($sections, function ($section) {
            // Set a default view to each section if none defined.
            /** @var SectionInterface $section */
            if (empty($section->getView())) {
                $section->setView('section');
            }
        });

        $this->repository()->setSections($sections);

        return $this;
    }
public function addSections ( array $ sections ) : PageInterface { $ sections = array_merge ( $ this -> repository ( ) -> getSections ( ) -> all ( ) , $ sections ) ; array_walk ( $ sections , function ( $ section ) { // Set a default view to each section if none defined. /** @var SectionInterface $section */ if ( empty ( $ section -> getView ( ) ) ) { $ section -> setView ( 'section' ) ; } } ) ; $ this -> repository ( ) -> setSections ( $ sections ) ; return $ this ; }
Add sections to the page.

@param array $sections

@return PageInterface
Add sections to the page .