@param Section $section

@return \Doctrine\ORM\Query
333163
public function getSectionHistoryQuery(Section $section)
    {
        $queryBuilder = $this->createQueryBuilder('contribution')
            ->orderBy('contribution.creationDate', 'DESC')
            ->andWhere('contribution.section = :section')
            ->setParameter('section', $section);

        return $queryBuilder->getQuery();
    }
740006
public function appendContentFromSection(Section $section)
    {
        $sortorder = $this->getContents()->count();

        foreach ($section->getContents() as $content)
        {
            $newContent = new \Coral\ContentBundle\Entity\Content;
            $newContent->setContent($content->getContent());
            $newContent->setRenderer($content->getRenderer());
            $newContent->setPermid($content->getPermid());
            $newContent->setSortorder(++$sortorder);
            $newContent->setSection($this);

            $this->addContent($newContent);
        }
    }
271143
protected function buildSection($sectionName, array $sectionDefinition): SectionInterface
    {
        $section = $this->sectionBuilder->buildSection($sectionName, $sectionDefinition);

        foreach ($this->filterCommands($sectionDefinition) as $commandName => $commandDefinition) {
            $section->addCommand($this->commandBuilder->buildCommand($commandName, $commandDefinition));
        }

        return $section;
    }
8837
public function getAllBySection($section, $default = null)
    {
        $items = $this->getSettingsConfig();

        if (isset($items[$section])) {
            $this->setting = ArrayHelper::getColumn($items[$section], 'value');
        } else {
            $this->setting = $default;
        }

        return $this->setting;
    }
1126433
private function section($sectionName)
    {
        if (!\array_key_exists($sectionName, $this->sectionList)) {
            throw new TplException(sprintf('section "%s" does not exist', $sectionName));
        }

        return $this->sectionList[$sectionName];
    }
418769
protected function getSection($sections, $section, $inheritance = false) {
		if (isset($sections[$section])) {
			return $sections[$section];
		}
		
		if ($inheritance) {
			foreach (array_keys($sections) as $part) {
				$colon = strpos($part, ':');

				if ($colon === false) {
					continue;
				}

				$successor = trim(substr($part, 0, $colon));
				$parent    = trim(substr($part, $colon + 1));
				
				if (! isset($successor[0], $parent[0])) {
					throw new InvalidIniSection('Invalid definition of the section "' . $part . '"');
				}

				if ($successor !== $section) {
					continue;
				}

				return array_replace(
					$this->getSection($sections, $parent, true),
					$sections[$part]
				);
			}
		}
		
		throw new InvalidIniSection('Section "' . $section . '" wasn\'t found');
	}
489354
public function getSection($section) {
		if (!isset($this->configValues[$section])) {
			return null;
		}
		return $this->configValues[$section];
	}
413390
protected function getSection(FieldTypeInterface $field, $section = null): SectionInterface
    {
        if (is_null($section)) {
            if ($this->repository->hasGroup($field->getOption('group'))) {
                $section = $this->repository->getGroup($field->getOption('group'));
            } else {
                $section = new Section($field->getOption('group'));
            }

            $section->addItem($field);
        }

        return $section;
    }
9388
public function activate($key, $section = null)
    {
        if (is_null($section)) {
            $pieces = explode('.', $key);
            $section = $pieces[0];
            $key = $pieces[1];
        }
        return $this->model->activateSetting($section, $key);
    }
890494
public function findCover($section)
    {
        $q = Eresus_DB::getHandler()->createSelectQuery();
        $e = $q->expr;
        $q->select('*');
        $q->from($this->getName());
        $q->where($e->lAnd(
            $e->eq('section', $q->bindValue($section, null, PDO::PARAM_INT)),
            $e->eq('active', $q->bindValue(true, null, PDO::PARAM_BOOL)),
            $e->eq('cover', $q->bindValue(true, null, PDO::PARAM_BOOL))
        ));

        $image = $this->loadOneFromQuery($q);
        if (!$image)
        {
            return false;
        }
        return $image;
    }
426313
private function parseSection(array $section)
    {
        $config = [];

        foreach ($section as $key => $value) {
            $this->parseKey($key, $value, $config);
        }

        return $config;
    }
245907
public function removeSection(\Coral\ContentBundle\Entity\Section $sections)
    {
        $this->sections->removeElement($sections);
    }
68065
public function addSection(NavigationSectionInterface $section, $priority = 1)
    {
        intval($priority);
        while (isset($this->sections[$priority])) {
            $priority++;
        }

        $this->sections[$priority] = $section;
        $section->setRootSection($this);

        return $section;
    }
953094
protected function getSection($section)
    {
        return isset($this->sections[$section])
            ? $this->sections[$section]
            : null;
    }
1141019
protected function processSection(array $section)
        {
            $config = array();

            foreach ($section as $key => $value) {
                $this->processKey($key, $value, $config);
            }

            return $config;
        }
357143
public function updateAction(Request $request, Section $section): Response
    {
        $this->denyAccessUnlessGranted(new Attribute('section', 'edit'));
        $form = $this->formFactory->updateSection(
            new SectionUpdateData($section)
        );
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $data = $form->getData();
            try {
                $sectionUpdateStruct = $this->sectionUpdateMapper->reverseMap($data);
                $section = $this->sectionService->updateSection($data->getSection(), $sectionUpdateStruct);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("Section '%name%' updated.") */
                        'section.update.success',
                        ['%name%' => $section->name],
                        'section'
                    )
                );

                return new RedirectResponse($this->generateUrl('ezplatform.section.view', [
                    'sectionId' => $section->id,
                ]));
            } catch (Exception $e) {
                $this->notificationHandler->error($e->getMessage());
            }
        }

        return $this->render('@ezdesign/admin/section/update.html.twig', [
            'section' => $section,
            'form_section_update' => $form->createView(),
        ]);
    }
249684
public function assignContentAction(Request $request, Section $section): Response
    {
        if (!$this->canUserAssignSectionToSomeContent($section)) {
            $exception = $this->createAccessDeniedException();
            $exception->setAttributes('state');
            $exception->setSubject('assign');

            throw $exception;
        }

        $form = $this->formFactory->assignContentSectionForm(
            new SectionContentAssignData()
        );
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (SectionContentAssignData $data) {
                $section = $data->getSection();

                $contentInfos = array_column($data->getLocations(), 'contentInfo');

                foreach ($contentInfos as $contentInfo) {
                    $this->sectionService->assignSection($contentInfo, $section);
                }

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("%contentItemsCount% content items were assigned to '%name%'") */
                        'section.assign_content.success',
                        ['%name%' => $section->name, '%contentItemsCount%' => count($contentInfos)],
                        'section'
                    )
                );

                return new RedirectResponse($this->generateUrl('ezplatform.section.view', [
                    'sectionId' => $section->id,
                ]));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('ezplatform.section.view', [
            'sectionId' => $section->id,
        ]));
    }