Loads all sections.

@throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException If the current user user is not allowed to read a section

@return \eZ\Publish\API\Repository\Values\Content\Section[]
438170
public function loadSections()
    {
        $sections = [];
        foreach ($this->sectionHandler->loadAll() as $spiSection) {
            $sections[] = $section = $this->buildDomainSectionObject($spiSection);

            // @todo change API to just filter instead of throwing here
            if (!$this->permissionResolver->canUser('section', 'view', $section)) {
                throw new UnauthorizedException('section', 'view');
            }
        }

        return $sections;
    }
51473
protected function sectionCurrentUser()
	{
		$u = Yii::$app->user;
		if ($u->isGuest) return ['Is guest'=>$this->valueBool(true)];

		//basics
		$identity = Yii::$app->user->identity;
		$ret = [
			'Is guest'=>$this->valueBool($u->isGuest),
			'ID'=>$this->valueBool($u->id),
			'Identity'=>$this->valueModal('Identity', $this->valueVarDump($identity), 'Show identity class'),
		];

		//rbac
		if (Yii::$app->authManager !== null) {
			$am = Yii::$app->authManager;
			$assigns = [];
			$roles = [];
			$perms = [];

			foreach ($am->getAssignments($u->id) as $assign) {
				$assigns[] = $this->valueCode($assign->roleName);
			}
			foreach ($am->roles as $role) {
				$roles[] = Html::tag('span', $role->name, ['class'=>'label label-' . ($u->can($role->name) ? 'success' : 'danger')]);
			}
			foreach ($am->permissions as $perm) {
				$perms[] = Html::tag('span', $perm->name, ['class'=>'label label-' . ($u->can($perm->name) ? 'success' : 'danger')]);
			}

			$ret['Assigned to'] = implode(', ', $assigns);
			$ret['Roles'] = implode(' ', $roles);
			$ret['Permissions'] = implode(' ', $perms);
		}

		return $ret;
	}
369393
public function loadAllSectionData()
    {
        $query = $this->dbHandler->createSelectQuery();
        $query->select(
            $this->dbHandler->quoteColumn('id'),
            $this->dbHandler->quoteColumn('identifier'),
            $this->dbHandler->quoteColumn('name')
        )->from(
            $this->dbHandler->quoteTable('ezsection')
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
794587
public function getAllSections()
    {
        $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/sections';
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET','');

        $json = json_decode($responseStream);
        if ($json->Code == 200) {
            return $json->Sections->SectionLinkList;
        }
        
        AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
            'json-code' => $json->Code,
        ));
        return false;
    }
891551
public static function loadAll()
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $permissionkeys = [];
        $txt = $app->make('helper/text');
        $e = $db->executeQuery(<<<'EOT'
select pkID, pkName, pkDescription, pkHandle, pkCategoryHandle, pkCanTriggerWorkflow, pkHasCustomClass, PermissionKeys.pkCategoryID, PermissionKeyCategories.pkgID
from PermissionKeys
inner join PermissionKeyCategories on PermissionKeyCategories.pkCategoryID = PermissionKeys.pkCategoryID
EOT
        );
        while (($r = $e->fetch(PDO::FETCH_ASSOC)) !== false) {
            if ($r['pkHasCustomClass']) {
                $class = '\\Core\\Permission\\Key\\' . $txt->camelcase($r['pkHandle'] . '_' . $r['pkCategoryHandle']) . 'Key';
            } else {
                $class = '\\Core\\Permission\\Key\\' . $txt->camelcase($r['pkCategoryHandle']) . 'Key';
            }
            $pkgHandle = $r['pkgID'] ? PackageList::getHandle($r['pkgID']) : null;
            $class = core_class($class, $pkgHandle);
            $pk = $app->make($class);
            $pk->setPropertiesFromArray($r);
            $permissionkeys[$r['pkHandle']] = $pk;
            $permissionkeys[$r['pkID']] = $pk;
        }

        $cache = $app->make('cache/request');
        if ($cache->isEnabled()) {
            $cache->getItem('permission_keys')->set($permissionkeys)->save();
        }

        return $permissionkeys;
    }
679886
public function getArray()
    {
        $contents = [];

        foreach (new DirectoryIterator($this->context) as $file) {
            if ($file->isDot()) {
                continue;
            }

            $className = $file->isDir() ? 'Directory' : ucfirst(strtolower($file->getExtension()));
            $classPath = 'PHLAK\\Config\\Loaders\\' . $className;

            $loader = new $classPath($file->getPathname());

            try {
                $contents = array_merge($contents, $loader->getArray());
            } catch (InvalidFileException $e) {
                // Ignore it and continue
            }
        }

        return $contents;
    }
1369601
public function fetch()
    {
        $adapter = $this->getAdapter();
        if (!$adapter)
            throw new \Exception("Adapter property is not set");

        $adapter->check($this);
        $adapter->filter($this);
        $adapter->sort($this);
        $result = $adapter->paginate($this);

        $filters = $this->getFilters();
        return [
            'sort_column'   => $this->getSortColumn(),
            'sort_dir'      => $this->getSortDir(),
            'page_number'   => $this->getPageNumber(),
            'page_size'     => $this->getPageSize(),
            'total_pages'   => $this->getTotalPages(),
            'filters'       => count($filters) ? $filters : new \StdClass(),
            'rows'          => $result,
        ];
    }
508969
public static function loadAll()
  {
    $list = [];
    foreach (self::getProfileList() as $definition) {
      $list[$definition['name']] = self::loadProfileByName($definition['name']);
    }
    return $list;
  }
953329
public function getUsers()
    {
        if(!$this->isPropertyAvailable('Users')){
            $this->setProperty("Users", new UserCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath() , "Users")));
        }
        return $this->getProperty("Users");
    }
1265225
public function loadAllSectionData()
    {
        try {
            return $this->innerGateway->loadAllSectionData();
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
326915
public function getContent()
    {
        $this->load();
        $content = [];
        foreach ($this->users as $user) {
            $content[] = $user->getFileLine().PHP_EOL;
        }
        return implode('', $content);
    }
409231
public function getFiles() : array
    {
        Filesystem::checkExists($this->path);
        Filesystem::checkReadable($this->path);
        $contents = [];

        $files = scandir($this->path);
        foreach ($files as $file) {
            if($file != '.' && $file != '..') {
                $contents[] = Filesystem::get("$this->path/$file");
            }
        }
        return $contents;
    }
870701
public function handleSection() {

        if ($ClassName = $this->owner->getRequest()->param('SECTIONNAME')) {
            $sections = $this->owner->data()->Sections();
            if ($section = $sections->filter(array('ClassName' => $ClassName))->first()) {
                if ($action = $this->owner->getRequest()->param('ACTION')) {
                    return $section->getController()->$action();
                }
            }
        }
        // return $section->getController();
    }
863010
protected function load_users() {
        global $CFG;

        // Create a graded_users_iterator because it will properly check the groups etc.
        $defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
        $showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradeshowactiveenrol);
        $showonlyactiveenrol = $showonlyactiveenrol || !has_capability('moodle/course:viewsuspendedusers', $this->context);

        require_once($CFG->dirroot.'/grade/lib.php');
        $gui = new \graded_users_iterator($this->course, null, $this->groupid);
        $gui->require_active_enrolment($showonlyactiveenrol);
        $gui->init();

        // Flatten the users.
        $users = array();
        while ($user = $gui->next_user()) {
            $users[$user->user->id] = $user->user;
        }
        $gui->close();
        return $users;
    }
335923
public function renderSections()
    {
        $env = $this->factory;

        return $this->render(function ($view) use ($env) {
            return $env->getSections();
        });
    }
121929
public function load()
    {
        $data = [];

        if (is_file($this->filePath)) {
            $data = json_decode(file_get_contents($this->filePath), true);
        }

        return $data;
    }
352401
protected function getLastSection()
    {
        if (0 === count($this->sections)) {
            throw new RenderException('Cannot end a section. You must start a section first.');
        }

        $keys = array_keys($this->sections);
        $key = array_pop($keys);

        return $this->sections[$key];
    }