Code Duplication    Length = 15-15 lines in 2 locations

eZ/Publish/Core/Repository/SectionService.php 1 location

@@ 195-209 (lines=15) @@
192
     *
193
     * @return \eZ\Publish\API\Repository\Values\Content\Section[]
194
     */
195
    public function loadSections()
196
    {
197
        if ($this->repository->hasAccess('section', 'view') !== true) {
198
            throw new UnauthorizedException('section', 'view');
199
        }
200
201
        $spiSections = $this->sectionHandler->loadAll();
202
203
        $sections = array();
204
        foreach ($spiSections as $spiSection) {
205
            $sections[] = $this->buildDomainSectionObject($spiSection);
206
        }
207
208
        return $sections;
209
    }
210
211
    /**
212
     * Loads a Section from its identifier ($sectionIdentifier).

eZ/Publish/Core/Repository/RoleService.php 1 location

@@ 882-896 (lines=15) @@
879
     *
880
     * @return \eZ\Publish\API\Repository\Values\User\Role[]
881
     */
882
    public function loadRoles()
883
    {
884
        if ($this->repository->hasAccess('role', 'read') !== true) {
885
            throw new UnauthorizedException('role', 'read');
886
        }
887
888
        $spiRoles = $this->userHandler->loadRoles();
889
890
        $roles = array();
891
        foreach ($spiRoles as $spiRole) {
892
            $roles[] = $this->roleDomainMapper->buildDomainRoleObject($spiRole);
893
        }
894
895
        return $roles;
896
    }
897
898
    /**
899
     * Deletes the given role.