Source of file TeamPage.php

Size: 0,935 Bytes - Last Modified: 2021-12-23T10:59:45+00:00

/var/www/docs.ssmods.com/process/src/src/TeamPage.php

12345678910111213141516171819202122232425262728293031323334353637383940414243
<?php

namespace WWN\Team;

use http\Client\Request;
use Page;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\SS_List;
use SilverStripe\View\ArrayData;

/**
 * TeamPage
 *
 * @package wwn-team
 */
class TeamPage extends Page
{
    /**
     * @return ArrayList|SS_List
     */
    public function Children()
    {
        $groups = TeamGroup::get()->sort('SortOrder ASC');
        $children = ArrayList::create();
        foreach ($groups as $group) {
            $children->push(
                new ArrayData(
                    [
                        'Link' => $this->URLSegment.'/'.$group->URLSegment,
                        'MenuTitle' => $group->Name,
                        'LinkingMode' => $group->LinkingMode(),
                    ]
                )
            );
        }

        return $children;
    }
}