@since 0.4

@param PageIdentifier $pageIdentifier
@param array $extraParams

@throws RuntimeException
@return Page
762770
public function getFromPageIdentifier(
		PageIdentifier $pageIdentifier,
		array $extraParams = []
	) {
		if ( !$pageIdentifier->identifiesPage() ) {
			throw new RuntimeException( '$pageIdentifier does not identify a page' );
		}
		if ( !is_null( $pageIdentifier->getId() ) ) {
			return $this->getFromPageId( $pageIdentifier->getId(), $extraParams );
		} else {
			return $this->getFromTitle( $pageIdentifier->getTitle(), $extraParams );
		}
	}
909781
public function getFromPageIdentifier( PageIdentifier $pageIdentifier ) {
		if ( !$pageIdentifier->identifiesPage() ) {
			throw new InvalidArgumentException( '$pageIdentifier does not identify a page' );
		}

		if ( !is_null( $pageIdentifier->getId() ) ) {
			return $this->getFromPageId( $pageIdentifier->getId() );
		} else {
			return $this->getFromTitle( $pageIdentifier->getTitle() );
		}
	}
108582
static function Url(PageUrl $pageUrl, array $additionalParameters = array())
    {
        $list = new PageParamListProvider($pageUrl);
        $params = $list->ToArray();
        foreach ($additionalParameters as $key => $value) {
            $params[$key] = $value;
        }
        return self::PageUrl($pageUrl->GetPage(), $params, $pageUrl->GetFragment());
    }
763531
public function moveFromPageId( $pageid, Title $target, array $extraParams = [] ) {
		$this->api->postRequest(
			new SimpleRequest( 'move', $this->getMoveParams( $pageid, $target, $extraParams ) )
		);

		return true;
	}
207132
private function decidePaginatorFormat(
        DoctrinePaginator $paginator,
        string $parameterType,
        int $limitPerPage,
        int $page
    ) {
        if (Pagerfanta::class === $parameterType) {
            $paginator = new Pagerfanta(new DoctrineORMAdapter($paginator->getQuery()));
            $paginator->setMaxPerPage($limitPerPage);
            $paginator->setCurrentPage($page);
        }
        if (PaginationInterface::class === $parameterType) {
            $knp = new KnpPaginator();
            $paginator = $knp->paginate($paginator->getQuery(), $page, $limitPerPage);
        }

        return $paginator;
    }
951086
private function getPagedListResponse(
        $methodName,
        array $optionalArgs,
        $decodeType,
        Message $request,
        $interfaceName = null
    ) {
        $callStack = $this->createCallStack(
            $this->configureCallConstructionOptions($methodName, $optionalArgs)
        );
        $descriptor = new PageStreamingDescriptor(
            $this->descriptors[$methodName]['pageStreaming']
        );
        $callStack = new PagedMiddleware($callStack, $descriptor);

        $call = new Call(
            $this->buildMethod($interfaceName, $methodName),
            $decodeType,
            $request,
            [],
            Call::UNARY_CALL
        );

        $this->modifyUnaryCallable($callStack);
        return $callStack($call, $optionalArgs)->wait();
    }
100044
public function deleteFromPageId( $pageid, array $extraParams = [] ) {
		$this->api->postRequest( new SimpleRequest(
			'delete',
			$this->getDeleteParams( new PageIdentifier( null, $pageid ), $extraParams )
		) );
		return true;
	}
97943
public function move( Page $page, Title $target, array $extraParams = [] ) {
		$this->api->postRequest(
			new SimpleRequest(
				'move', $this->getMoveParams( $page->getId(), $target, $extraParams )
			)
		);

		return true;
	}
221556
public function getSiteByPageId($pageId, $mountPointIdentifier = '')
    {
        $rootPageId = $this->rootPageResolver->getRootPageId($pageId, false, $mountPointIdentifier);
        return $this->getSiteByRootPageId($rootPageId);
    }
311849
protected function importCustomizeExtra( $rootParagraphId, $extra )
    {
        /* @var $mapper \Grid\Customize\Model\Extra\Mapper */
        $model  = $this->getSheetModel();
        $mapper = $model->getMapper()->getExtraMapper();
        $extra  = $mapper->create( array(
            'rootParagraphId'   => $rootParagraphId,
            'extra'             => $extra,
        ) );

        return $extra->save();
    }
698576
public function loadTypeDataByIdentifier($identifier, $status)
    {
        try {
            return $this->innerGateway->loadTypeDataByIdentifier($identifier, $status);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1056257
public function setTemplateIdentifier($templateIdentifier)
    {
        if (Format::isIdentifier($templateIdentifier, false) === true) {
            $this->templateIdentifier = $templateIdentifier;
        } else {
            $msg = "The 'templateIdentifier' argument must be a valid QTI identifier, '" . $templateIdentifier . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1019328
public function delete( Page $page, array $extraParams = [] ) {
		$this->api->postRequest( new SimpleRequest(
			'delete',
			$this->getDeleteParams( $page->getPageIdentifier(), $extraParams )
		) );
		return true;
	}
888365
public function findByIdentifier($identifier, $pageTsPids = array())
    {
        $backendLayouts = $this->findAll($pageTsPids);
        if (isset($backendLayouts[$identifier])) {
            return $backendLayouts[$identifier];
        } else {
            return null;
        }
    }
479505
public function getRandom( array $extraParams = [] ) {
		$params = array_merge( $extraParams, [ 'list' => 'random' ] );
		return $this->runQuery( $params, null, 'random', 'id', false );
	}
1136132
public function findByName($name, $extraDatas = array(), $executeQuery = true)
    {
        $name  = strtoupper($name);
        /** @var \Doctrine\ORM\QueryBuilder $queryBuilder */
        $queryBuilder = $this->createQueryBuilder('resourceNode');
        $queryBuilder->where($queryBuilder->expr()->like('UPPER(resourceNode.name)', ':name'));

        if (0 < count($extraDatas)) {
            foreach ($extraDatas as $key => $extraData) {
                $queryBuilder
                    ->andWhere(sprintf('resourceNode.%s = :%s', $key, $key))
                    ->setParameter(sprintf(':%s', $key), $extraData);
            }
        }

        $queryBuilder
            ->orderBy('resourceNode.name', 'ASC')
            ->setParameter(':name', "%{$name}%");

        return $executeQuery ? $queryBuilder->getQuery()->getResult(): $queryBuilder;
    }
215715
public function processAuthenticate($signature, $extra = null)
    {
        $this->getRealm();
        $token = (new Parser())->parse($signature);

        $iss = $token->getClaim('iss');
        $iss = base64_decode($iss);
        if (!isset($this->activeRealms[$iss])) {
            return resolve(["FAILURE"]);
        }

        if ($token->verify(new Sha256(), $this->activeRealms[$iss])) {
            return resolve(["SUCCESS", ['authid' => $token->getClaim('authid')]]);
        }

        return resolve(["FAILURE"]);
    }