@param string $currentSiteId

@return array
333764
protected function getChoices($currentSiteId = null)
    {
        $sites = $this->siteRepository->findByDeleted(false);
        $choices = array();

        foreach ($sites as $site) {
            if (null === $currentSiteId || $currentSiteId !== $site->getSiteId()) {
                $choices[$site->getName()] = $site->getSiteId();
            }
        }

        return $choices;
    }
1046620
public function getItemDetails($id)
    {
        $comment = new Comment();
        $comment->setDb($this->di->get("db"));
        $comment->find("id", $id);
        return $comment;
    }
780244
public function getOrderNumber($id, $currentQuery = null)
    {
        $item = $this->findOne($id);
        if (!isset($item)) return 0;

        if (empty($currentQuery)) {
            $query = self::find()->orderBy($this->orderBy);
        } else {
            $query = clone $currentQuery; //!
        }
        foreach ($this->orderBy as $prio_field => $direction) {
            $item_prio = $item[$prio_field];
            $where = [$direction == SORT_ASC ? '<=' : '>=', $prio_field, $item_prio];
            $query = $query->andWhere($where);
        }
        $num = $query->count();
        return intval($num);
    }
34797
public function getCurrentItems() {
		if ($this->_currentItems === null) {
			$offset = $this->_itemsPerPage * $this->_currentPage - $this->_itemsPerPage;
			
			$this->_currentItems = $this->getAdapter()->getItems($offset, $this->_itemsPerPage);
			
			if (! $this->_currentItems instanceof Traversable) {
				throw new RuntimeException('Data from an adapter must implement the "Traversable" interface');
			}
		}
		
		return $this->_currentItems;
	}
297679
public function getCurrentPage($contextId = null)
    {
        $pager = $this->offsetGet($contextId) ?: $this->offsetGet('');

        return ($pager) ? $pager->current : 1;
    }
1050800
protected function getAcfFromPage(int $pageId): array
    {
        $data = [];
        try {
            $data = $this->wpProvider->getFields($pageId);
        } catch (\Throwable $e) {
            ;
        }

        if (!is_array($data) || empty($data)) return [];

        return $data;
    }
619798
public function GetActiveShopModuleArticlelistOrderbyId($sInstanceId = '')
    {
        $iActiveShopModuleArticlelistOrderbyId = null;
        $oGlobal = TGlobal::instance();
        if ($oGlobal->UserDataExists(self::URL_ORDER_BY)) {
            $iActiveShopModuleArticlelistOrderbyId = $oGlobal->GetUserData(self::URL_ORDER_BY);
        } else {
            if (array_key_exists(self::SESSION_ACTIVE_ORDER_BY.$sInstanceId, $_SESSION)) {
                $iActiveShopModuleArticlelistOrderbyId = $_SESSION[self::SESSION_ACTIVE_ORDER_BY.$sInstanceId];
            }
        }

        return $iActiveShopModuleArticlelistOrderbyId;
    }
696074
private function getTemplateData($currentContent, $code, \Exception $exception, DebugLoggerInterface $logger = null)
    {
        return [
            'exception' => FlattenException::create($exception),
            'status' => 'error',
            'status_code' => $code,
            'status_text' => array_key_exists($code, Response::$statusTexts) ? Response::$statusTexts[$code] : 'error',
            'currentContent' => $currentContent,
            'logger' => $logger,
        ];
    }
1176150
public function getSiteInfo(int $appId) : array
    {
        Assert::that($appId)->greaterThan(0, 'The $appId has to be positive');
        return (array)$this->master->doRequest(
            'GET',
            sprintf(
                '/admin/WEBAPI/Endpoints/v1_0/PluginService/{KEY}/SiteInfo/%s',
                $appId
            )
        );
    }
289340
public function getManipulatableRoles(array $currentUser)
    {
        $manipulatableRoles = [];

        foreach ($this->getDefinedRoles() as $roleName => $role) {
            if ($this->checkPermission($currentUser['roles'], 'manipulate', 'roles-hierarchy', $roleName)) {
                $manipulatableRoles[] = $roleName;
            }
        }

        return $manipulatableRoles;
    }
271823
public function clientSettingsAction(Site $currentSite)
    {
        $providers = [];

        if ($currentSite->hasAttribute('seo.piwik.url')) {
            $providers['piwik'] = "Piwik";
        }
        if ($currentSite->hasAttribute('seo.google.ga_id')) {
            $providers['google-analytics'] = "Google Analytics";
        }

        return $this->render('@ucms_seo/views/privacy-settings.html.twig', ['providers' => $providers]);
    }
15567
public function getItems($offset, $itemCountPerPage)
    {
        if ($offset >= $this->count()) {
            return array();
        }

        $remainItemCount  = $this->count() - $offset;
        $currentItemCount = $remainItemCount > $itemCountPerPage ? $itemCountPerPage : $remainItemCount;

        return array_fill(0, $currentItemCount, null);
    }
1193374
protected function currentPictures($current)
	{
		if (is_string($current) || is_null($current) || count($current) == 0){
			return ['id' => null, 'path' => $current];
		}

		return $current->map(function ($item) {
			$array = [
				'id' => $item['id'],
				'path' => $item['path']
			];

			return $array;
		})->all();
	}
1052785
protected function getDirtyAttributes(array $actual, array $cached): array
    {
        $dirty = [];

        foreach ($actual as $key => $value) {
            if (!$this->originalIsNumericallyEquivalent($value, $cached[$key])) {
                $dirty[$key] = $actual[$key];
            }
        }

        return $dirty;
    }
387673
public static function getCurrent($navigation, $current) {
        self::iterateItems($navigation);
        foreach(self::$navItem as $item) {
            if($item === $current) {
                self::getCurrentItem(intval(floor(self::$navItem->getDepth() / 2)));
            }
        }
        ksort(self::$currentItems);
        return self::$currentItems;
    }
998294
protected function getNextElements($current): array
    {
        $collection = FormFieldModel::findBy(
            [
                'tl_form_field.pid=?',
                '(tl_form_field.type != ? AND tl_form_field.bs_grid_parent = ?)',
                'tl_form_field.sorting > ?'
            ],
            [$current->pid, 'bs_gridStop', $current->id, $current->sorting],
            ['order' => 'tl_form_field.sorting ASC']
        );

        if ($collection) {
            return $collection->getIterator()->getArrayCopy();
        }

        return [];
    }
1170304
public function actionNavLangItem($navId, $langId)
    {
        $item = NavItem::find()->with('nav')->where(['nav_id' => $navId, 'lang_id' => $langId])->one();
        if ($item) {
            return [
                'error' => false,
                'item' => $item->toArray(),
                'nav' => $item->nav->toArray(),
                'typeData' => ($item->nav_item_type == 1) ? NavItemPage::getVersionList($item->id) : ArrayHelper::typeCast($item->getType()->toArray()),
            ];
        }
        
        return ['error' => true];
    }