Get all the slots in a section of the quiz.
@param int $sectionid the section id.
@return int[] slot numbers.
495077
public function get_slots_in_section($sectionid) {
        $slots = array();
        foreach ($this->slotsinorder as $slot) {
            if ($slot->section->id == $sectionid) {
                $slots[] = $slot->slot;
            }
        }
        return $slots;
    }
830514
public function getSectionRouteRules(string $section, string $format = 'Craft', $siteId = null): array
    {
        return RouteMap::$plugin->routes->getSectionRouteRules($section, $format, $siteId);
    }
462815
public function getDepartments($departmentId)
    {
        $apiUrl = 'https://qyapi.weixin.qq.com/cgi-bin/department/list';

        $result = $this->_curl($apiUrl, [
            'access_token' => $this->getAccessToken(),
            'id' => $departmentId,
        ]);

        return ($result and isset($result['department'])) ? $result['department'] : null;
    }
735022
def sectionByID(self, sectionID):
        
        if not self._sectionsByID or sectionID not in self._sectionsByID:
            self.sections()
        return self._sectionsByID[sectionID]
153525
public function getStoreIdsFromThesaurusId($thesaurusId)
    {
        $connection = $this->getConnection();

        $select = $connection->select();

        $select->from($this->getTable(ThesaurusInterface::STORE_TABLE_NAME), ThesaurusInterface::STORE_ID)
            ->where(ThesaurusInterface::THESAURUS_ID . ' = ?', (int) $thesaurusId);

        return $connection->fetchCol($select);
    }
1370572
private function getSectionId($locationId)
    {
        $location = $this->load($locationId);
        $locationContentInfo = $this->contentHandler->loadContentInfo($location->contentId);

        return $locationContentInfo->sectionId;
    }
1200222
protected function getSectionFilterQuery( $sectionIdent )
    {
        if ( empty( $sectionIdent ) )
        {
            return null;
        }

        if ( is_array( $sectionIdent ) )
        {
            $sectionQueryParts = array();
            foreach ( $sectionIdent as $sectionID )
            {
                $sectionID = trim( $sectionID );
                if ( ctype_digit( $sectionID ) )
                {
                    $sectionQueryParts[] = eZSolr::getMetaFieldName( 'section_id' ) . ':' . $sectionID;
                }
                else
                {
                    eZDebug::writeError( "Unknown section_id filtering parameter: $sectionID", __METHOD__ );
                }
            }

            return implode( ' OR ', $sectionQueryParts );
        }

        $sectionIdent = trim( $sectionIdent );
        if ( ctype_digit( $sectionIdent ) )
        {
            return eZSolr::getMetaFieldName( 'section_id' ) . ':' . $sectionIdent;
        }

        eZDebug::writeError( 'No valid section id', __METHOD__ );

        return null;
    }
784108
public function actionGetSectionUrls(string $section, array $criteria = [], $siteId = null): Response
    {
        return $this->asJson(RouteMap::$plugin->routes->getSectionUrls($section, $criteria, $siteId));
    }
591605
private function getCategory($categoryId)
    {
        if (!array_key_exists($categoryId, $this->categories)) {
            $categoryCollection = $this->categoryCollectionFactory->create();
            foreach ($categoryCollection as $category) {
                $this->categories[$category->getId()] = $category;
            }
        }

        return $this->categories[$categoryId];
    }
647838
public function findInSection($id, $limit = null, $offset = 0, $all = false)
    {
        $q = $this->createSelectQuery();
        $q->where($q->expr->eq('section', $q->bindValue($id, null, PDO::PARAM_STR)));
        $q->orderBy('position');
        return $this->loadFromQuery($q, $limit, $offset);
    }
292016
public function loadSectionData($id)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query->select(
            $this->dbHandler->quoteColumn('id'),
            $this->dbHandler->quoteColumn('identifier'),
            $this->dbHandler->quoteColumn('name')
        )->from(
            $this->dbHandler->quoteTable('ezsection')
        )->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('id'),
                $query->bindValue($id, null, \PDO::PARAM_INT)
            )
        );

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

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
790626
protected function get_slots_by_slotid($slots) {
        if (!$slots) {
            return array();
        }
        $newslots = array();
        foreach ($slots as $slot) {
            $newslots[$slot->id] = $slot;
        }
        return $newslots;
    }
1207381
public function getLocalizedStack(Section $section, $cvID = 'RECENT')
    {
        $result = null;
        $mySectionID = $this->getMultilingualSectionID();
        if ($mySectionID !== 0 && $section->getCollectionID() == $mySectionID) {
            $result = $this;
        } else {
            $neutralID = ($mySectionID === 0) ? $this->getCollectionID() : $this->getNeutralStackID();
            $db = Database::connection();
            $localizedID = $db->fetchColumn(
                '
                    select
    	               Stacks.cID
                    from
    	               Stacks
    	               inner join Pages on Stacks.cID = Pages.cID
                    where
    	               Pages.cParentID = ? and Stacks.stMultilingualSection = ?
                    limit 1
                ',
                [$neutralID, $section->getCollectionID()]
            );
            if ($localizedID) {
                $localized = static::getByID($localizedID, $cvID);
                if ($localized) {
                    $result = $localized;
                }
            }
        }

        return $result;
    }
414961
private function getSections() {
		$sections = array();
		foreach (Craft::$app->getSections()->getEditableSections() as $section) {
			$sections[$section->id] = Craft::t('site', $section->name);
		}
		return $sections;
	}
112522
public function findElementsByPageId($pageId)
    {
        $this->makeSelect();
        $this->sql .= ' and page_element.page_id = ? order by block_key, element_sort';
        $this->bindValues[] = $pageId;

        return $this->find();
    }
508627
public function getCategory4Id($categoryId)
    {
        /** @var \ZfcTicketSystem\Entity\Repository\TicketCategory $repository */
        $repository = $this->getEntityManager()->getRepository($this->getEntityOptions()->getTicketCategory());
        return $repository->getCategory4Id($categoryId);
    }
237047
protected function getItems($sectionId, $limit, $offset)
    {
        // TODO Добавить в этот класс ссылку на плагин
        $plugin = Eresus_Plugin_Registry::getInstance()->load('gallery');
        /* @var Gallery_Entity_Table_Image $table */
        $table = ORM::getTable($plugin, 'Image');
        $items = $table->findInSection($sectionId, $limit, $offset);
        return $items;
    }