Fetch section object given either section id or section identifier. There should be one and only one parameter.
@param integer $sectionID
@param string $sectionIdentifier
@return object
184663
function fetchSectionObject( $sectionID = false, $sectionIdentifier = false )
    {
        if( $sectionID !== false )
        {
            if( $sectionIdentifier !== false )
            {
                $sectionObject = null;
            }
            else
            {
                $sectionObject = eZSection::fetch( $sectionID );
            }
        }
        else
        {
            if( $sectionIdentifier === false )
            {
                $sectionObject = null;
            }
            else
            {
                $sectionObject = eZSection::fetchByIdentifier( $sectionIdentifier );
            }
        }
        if ( $sectionObject === null )
            return array( 'error' => array( 'error_type' => 'kernel',
                                            'error_code' => eZError::KERNEL_NOT_FOUND ) );
        return array( 'result' => $sectionObject );
    }
1060063
public function updateEntryById(string $sectionHandle, int $id): JsonResponse
    {
        $request = $this->requestStack->getCurrentRequest();

        $optionsResponse = $this->preFlightOptions($request, self::ALLOWED_HTTP_METHODS);
        if ($optionsResponse) {
            return $optionsResponse;
        }

        $this->dispatcher->dispatch(
            ApiUpdateEntry::NAME,
            new ApiUpdateEntry($request, $sectionHandle)
        );

        if ($abort = $this->shouldAbort($request)) {
            return $abort;
        }

        try {
            $responseData = [ 'code' => JsonResponse::HTTP_OK ];
            $this->putToPost();
            $form = $this->form->buildFormForSection(
                $sectionHandle,
                $this->requestStack,
                SectionFormOptions::fromArray([
                    ReadOptions::ID => $id
                ]),
                false
            );

            $originalEntry = clone $this->readSection->read(
                ReadOptions::fromArray([
                    ReadOptions::SECTION => $sectionHandle,
                    ReadOptions::ID => $id
                ])
            )->current();

            $form->submit($request->get($form->getName()), false);

            $jsonResponse = new JsonResponse(
                $responseData,
                $responseData['code'],
                $this->getDefaultResponseHeaders($request)
            );

            if ($form->isValid()) {
                $newEntry = $form->getData();
                $this->dispatcher->dispatch(
                    ApiBeforeEntryUpdatedAfterValidated::NAME,
                    new ApiBeforeEntryUpdatedAfterValidated(
                        $request,
                        $responseData,
                        $jsonResponse,
                        $originalEntry,
                        $newEntry
                    )
                );

                if ($abort = $this->shouldAbort($request)) {
                    return $abort;
                }

                $responseData = $this->save($form, $jsonResponse, $request);
                $jsonResponse->setData($responseData);
                $this->dispatcher->dispatch(
                    ApiEntryUpdated::NAME,
                    new ApiEntryUpdated(
                        $request,
                        $responseData,
                        $jsonResponse,
                        $originalEntry,
                        $newEntry
                    )
                );
            } else {
                $responseData['errors'] = $this->getFormErrors($form);
                $responseData['code'] = JsonResponse::HTTP_BAD_REQUEST;
                $jsonResponse->setData($responseData);
                $jsonResponse->setStatusCode($responseData['code']);
            }

            return $jsonResponse;
        } catch (\Exception $exception) {
            return $this->errorResponse($request, $exception);
        }
    }
440995
public function getCategories($domainName, $sectionName): Finder
    {
        if (!in_array($sectionName, $this->getSectionNames($domainName))) {
            throw new \Exception('Section not found for given domain');
        }

        return (new Finder())
            ->directories()
            ->in(__DIR__.DIRECTORY_SEPARATOR.$domainName.DIRECTORY_SEPARATOR.$sectionName)
            ->depth(0)
        ;
    }
1372133
public static function get_modules_from_sectionid($sectionid) {
        global $DB;

        // Get the course and sequence of the section
        $secrec = $DB->get_record('course_sections', array('id' => $sectionid), 'course, sequence');
        $courseid = $secrec->course;
        $sequence = $secrec->sequence;

        // Get the section->sequence contents (it roots the activities order)
        // Get all course modules belonging to requested section
        $modulesarr = array();
        $modules = $DB->get_records_sql("
            SELECT cm.id, m.name AS modname
              FROM {course_modules} cm
              JOIN {modules} m ON m.id = cm.module
             WHERE cm.course = ?
               AND cm.section = ?
               AND cm.deletioninprogress <> 1", array($courseid, $sectionid));
        foreach (explode(',', $sequence) as $moduleid) {
            if (isset($modules[$moduleid])) {
                $module = array('id' => $modules[$moduleid]->id, 'modname' => $modules[$moduleid]->modname);
                $modulesarr[] = (object)$module;
                unset($modules[$moduleid]);
            }
        }
        if (!empty($modules)) { // This shouldn't happen, but one borked sequence can lead to it. Add the rest
            foreach ($modules as $module) {
                $module = array('id' => $module->id, 'modname' => $module->modname);
                $modulesarr[] = (object)$module;
            }
        }
        return $modulesarr;
    }
1248324
public function update($id, $name, $identifier)
    {
        $this->sectionGateway->updateSection($id, $name, $identifier);

        $section = new Section();
        $section->id = $id;
        $section->name = $name;
        $section->identifier = $identifier;

        return $section;
    }
277594
public function assignSectionToContent($sectionId, $contentId)
    {
        try {
            return $this->innerGateway->assignSectionToContent($sectionId, $contentId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
869110
public static function get(string $section, $row = null) {
        if ($row === null) {
            return isset(self::$config[$section]) ? self::$config[$section] : null;
        } else {
            return isset(self::$config[$section][$row]) ? self::$config[$section][$row] : null;
        }
    }
645062
public function isRegistered($identifier)
    {
        $this->verifySectionName($identifier);

        return array_key_exists($identifier, $this->registry[$this->section]);
    }
570550
def section(self):
        
        if self.api and self.section_id:
            return self.api._get_section(self.section_id)
405248
private function getItemKey(
        string $sectionHandle,
        array $requestedFields = null,
        string $context = null,
        string $id = null
    ): string {
        return sha1($sectionHandle) .
            $this->getFieldKey($requestedFields) .
            $this->getContextKey($context) .
            $this->getIdKey($id);
    }
777074
public function read(
        ReadOptionsInterface $options,
        SectionConfig $sectionConfig = null
    ): \ArrayIterator {
        $sectionData = new \ArrayIterator();

        $this->dispatcher->dispatch(
            SectionBeforeRead::NAME,
            new SectionBeforeRead($sectionData, $options, $sectionConfig)
        );

        if ($sectionConfig === null && count($options->getSection()) > 0) {
            $sectionConfig = $this->sectionManager->readByHandle(
                $options->getSection()[0]->toHandle()
            )->getConfig();
        }

        // Make sure we are passing the fully qualified class name as the section
        if (count($options->getSection()) > 0) {
            $optionsArray = $options->toArray();
            $optionsArray[ReadOptions::SECTION] = (string)$sectionConfig->getFullyQualifiedClassName();
            $options = ReadOptions::fromArray($optionsArray);
        }

        /** @var ReadSectionInterface $reader */
        foreach ($this->readers as $reader) {
            foreach ($reader->read($options, $sectionConfig) as $entry) {
                $sectionData->append($entry);
            }
        }

        $this->dispatcher->dispatch(
            SectionDataRead::NAME,
            new SectionDataRead($sectionData, $options, $sectionConfig)
        );

        return $sectionData;
    }
108747
protected function renderSection($sectionName, $sectionData, OutputInterface $output, FormatterHelper $formatter)
    {
        $output->writeln('');
        $output->writeln('');
        $optionsHeader = $formatter->formatSection($sectionName, '');
        $output->writeln($optionsHeader);

        foreach ($sectionData as $serviceId => $service) {
            $output->writeln('');
            $output->writeln(" - <comment>$serviceId</comment>:");

            // Class
            $output->writeln('');
            $output->writeln("     <comment>Class</comment>: ${service['class']}");

            // Routes
            $output->writeln('');
            $output->writeln('     <comment>Routes</comment>:');
            foreach ($service['routes'] as $consumerRoute) {
                $output->writeln("     - $consumerRoute");
            }

            // Options
            if (!empty($service['options'])) {
                $output->writeln('');
                $output->writeln('     <comment>Options</comment>:');
                foreach ($service['options'] as $consumerOptionName => $consumerOption) {
                    $output->writeln("     - <comment>$consumerOptionName</comment>:");
                    $output->writeln("         $consumerOption[0]");
                    if (!empty($consumerOption[1])) {
                        $output->writeln('         Accepted values:');
                        foreach ($consumerOption[1] as $value => $valueDescription) {
                            $output->writeln("         - <comment>$value</comment>: $valueDescription");
                        }
                    }
                }
            }
        }
    }
1155242
public static String getLabel(String section, String idInSection) {
		Language language=getThreadLocalLanguage(null);
		
		if (language==null){
			return idInSection;
		} else {
			return getLabel(language, section, idInSection);
		}
	}
63805
public function get_section($section) {
		if($this->isInitialized === true) {
			$retval = $this->fullConfig[$section];
		}
		else {
			throw new exception(__METHOD__ .": not initialized");
		}
		
		return($retval);
	}
475666
public function updateSection($sectionId, Request $request)
    {
        $createStruct = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        try {
            return $this->sectionService->updateSection(
                $this->sectionService->loadSection($sectionId),
                $this->mapToUpdateStruct($createStruct)
            );
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }
    }
1043694
protected function isSectionAllowed($sectionId)
    {
        $container = $this->getRequest()->getParam('container');
        $store = $this->getRequest()->getParam('store');
        if ($store) {
            $this->backendConfig->setStore($store);
        } elseif ($container) {
            $this->backendConfig->setContainer($container);
        }

        return $this->sectionChecker->isSectionAllowed($sectionId);
    }
858931
public function get($sectionName, $itemName, $defaultValue = null)
    {
        $section = $this->getSection($sectionName);

        return $section->get($itemName, $defaultValue);
    }