@param int    $id             The id
@param string $context        The context
@param int    $sequenceNumber The sequence number

@return PagePartInterface
978921
public function getPagePart($id, $context = 'main', $sequenceNumber)
    {
        $ppRef = $this->find($id);
        $ppRef->setContext($context);
        $ppRef->setSequenceNumber($sequenceNumber);
        $this->getEntityManager()->persist($ppRef);
        $this->getEntityManager()->flush($ppRef);

        return $this->getEntityManager()->getRepository($ppRef->getPagePartEntityName())->find($ppRef->getPagePartId());
    }
150393
public function getSegmentCount($pageNumber = '', $fragmentNumber = '')
    {


        if ($pageNumber == '')
            throw new Exception('page number not specified');

        if ($fragmentNumber == '')
            throw new Exception('fragment number not specified');


        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/fragments/' . $fragmentNumber;

        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        return count($json->TextItems->List);
    }
1091989
public function subsequentByPeriodByVoucherTypeByNumberAndByOrganization($periodId, $voucherTypeId, $number, $organizationId, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->JournalVoucher->setConnection($databaseConnectionName)
      ->where('period_id', '=', $periodId)
      ->where('voucher_type_id', '=', $voucherTypeId)
      ->where('number', '>', $number)
      ->where('organization_id', '=', $organizationId)
      ->get();
  }
1157159
protected final String computeId(
            final ITemplateContext context,
            final IProcessableElementTag tag,
            final String name, final boolean sequence) {

        String id = tag.getAttributeValue(this.idAttributeDefinition.getAttributeName());
        if (!org.thymeleaf.util.StringUtils.isEmptyOrWhitespace(id)) {
            return (StringUtils.hasText(id) ? id : null);
        }

        id = FieldUtils.idFromName(name);
        if (sequence) {
            final Integer count = context.getIdentifierSequences().getAndIncrementIDSeq(id);
            return id + count.toString();
        }
        return id;

    }
1145960
public function sequence($sequence_name, $type = 'nextval', $tenant = null, $module = null) {
		return $this->object->sequence($sequence_name, $type, $tenant, $module);
	}
199610
protected function generateNumber($index, SequenceSubjectInterface $order)
    {
        do {
            $number = $this->generateSegment(3).'-'.$this->generateSegment(7).'-'.$this->generateSegment(7);
        } while ($this->subjectRepository->isNumberUsed($number));

        return $number;
    }
598882
public function createPageBasedPagination(int $defaultPage = 0, int $defaultSize = 0): PageBasedPagination
    {
        return PageBasedPagination::fromPaginationQueryParams($this->request->getPagination(), $defaultPage, $defaultSize);
    }
1310945
public byte[] sendQuerySm(OutputStream os, int sequenceNumber,
            String messageId, TypeOfNumber sourceAddrTon,
            NumberingPlanIndicator sourceAddrNpi, String sourceAddr)
            throws PDUStringException, IOException {
        synchronized (os) {
            return pduSender.sendQuerySm(os, sequenceNumber, messageId,
                    sourceAddrTon, sourceAddrNpi, sourceAddr);
        }
    }
83738
public function getByEntity($entityClass, $id, $locale, $object = null)
    {
        if (!$object) {
            $object = $this->documentManager->find($id, $locale);
        }

        $pageNumber = $object->getPageNumber();
        if ($object instanceof ArticlePageDocument) {
            // the article contains the seo/excerpt data and the controller handles the page-number automatically
            $object = $object->getParent();
        }

        $metadata = $this->structureMetadataFactory->getStructureMetadata('article', $object->getStructureType());

        // this parameter should not be used
        // but the sulu-collector for the profiler needs it to determine data from request
        $structure = $this->structureManager->wrapStructure('article', $metadata);
        $structure->setDocument($object);

        return [
            'object' => $object,
            'view' => $metadata->view,
            'pageNumber' => $pageNumber,
            'structure' => $structure,
            '_cacheLifetime' => $this->getCacheLifetime($metadata),
            '_controller' => $metadata->controller,
        ];
    }
826357
protected function getPaginator4QueryBuilder(QueryBuilder $queryBuilder, int $count, int $page = 1): ?Paginator
    {
        if (!$queryBuilder) {
            return null;
        }

        $paginator = new Paginator(
            new DoctrineAdapter\SimpleQueryDoctrine($count, $queryBuilder->getQuery())
        );
        $paginator->setDefaultItemCountPerPage(25);
        $paginator->setCurrentPageNumber($page);

        return $paginator;
    }
933704
public function getPageParts(HasPagePartsInterface $page, $context = 'main')
    {
        /** @var $entityRepository PagePartRefRepository */
        $entityRepository = $this->em->getRepository('KunstmaanPagePartBundle:PagePartRef');
        $pageparts = $entityRepository->getPageParts($page, $context);

        return $pageparts;
    }
512150
public function getTemplate($id, $context = Theme::CONTEXT_BACKOFFICE)
    {
        $templates = $this->getOption(static::TEMPLATES);

        if (is_null($templates) || empty($templates[$id])) {
            return Template::getTemplate('blocks/' . $id . '.tpl', 'tao');
        }

        if ($templates[$id] === static::DEFAULT_PATH) {
            return Template::getTemplate(
                $this->defaultThemePath . '/' . $id . '.tpl',
                $this->getOption(static::EXTENSION_ID)
            );
        }

        // otherwise it will be assumed the template is already configured
        return $templates[$id];
    }
1173839
public function addTextEvidence($id, $contentOrRequest)
    {
        $request = is_array($contentOrRequest) ? $contentOrRequest : ['content' => $contentOrRequest];
        if (trim($request['content']) == "") {
            throw new InvalidArgumentException('content cannot be blank');
        }

        try {
            $evidence = [
                'comments' => $request['content'],
            ];

            if (trim($id) == "") {
                throw new Exception\NotFound();
            }

            if (array_key_exists('tag', $request)) {
                $evidence['category'] = $request['tag'];
            }

            if (array_key_exists('category', $request)) {
                if (trim($request['category']) == "") {
                    throw new InvalidArgumentException('category cannot be blank');
                }
                $evidence['category'] = $request['category'];
            }

            if (array_key_exists('sequenceNumber', $request)) {
                if (trim($request['sequenceNumber']) == "") {
                    throw new InvalidArgumentException('sequenceNumber cannot be blank');
                } else if ((string)(int)($request['sequenceNumber']) != $request['sequenceNumber']) {
                    throw new InvalidArgumentException('sequenceNumber must be an integer');
                }
                $evidence['sequenceNumber'] = (int)$request['sequenceNumber'];
            }

            $path = $this->_config->merchantPath() . '/disputes/' . $id . '/evidence';
            $response = $this->_http->post($path, [
                'evidence' =>  $evidence
            ]);

            if (isset($response['apiErrorResponse'])) {
                return new Result\Error($response['apiErrorResponse']);
            }

            if (isset($response['evidence'])) {
                $evidence = new Dispute\EvidenceDetails($response['evidence']);
                return new Result\Successful($evidence);
            }
        } catch (Exception\NotFound $e) {
            throw new Exception\NotFound('dispute with id "' . $id . '" not found');
        }
    }
11367
private function makeQuery($pageNumber = 1)
    {
        $params = array(
            'page_size' => $this->pageSize,
            'page' => $pageNumber
        );
        $params = array_merge($params, $this->filter);
        $params = array_merge($params, $this->order);
        $response = $this->api->get($this->typeClass->url(), $params);
        $this->countCached = $response->meta->total_count;

        return $response;
    }
873488
public function getParentPagesQuery($locale, $id = null, $showHome = false, $showChildren = false)
    {
        $qb = $this->createQueryBuilder('p');
        if (!$showHome) {
            $qb->where($qb->expr()->isNull('p.isHome').' OR p.isHome <> 1');
        }
        if ($id) {
            if (!$showChildren) {
                /** @var $page PageInterface */
                $page = $this->find($id);
                $collection = new ArrayCollection($page->getAllChildren());
                $childrenIds = $collection->map(
                    function (PageInterface $p) {
                        return $p->getId();
                    }
                );

                if ($childrenIds->count()) {
                    $qb->andWhere($qb->expr()->notIn('p.id', $childrenIds->toArray()));
                }
            }
            $qb->andWhere($qb->expr()->neq('p.id', $id));
        }

        $qb->andWhere('p.locale = :locale');
        $qb->orderBy('p.path', 'ASC');

        $qb->setParameter(':locale', $locale);

        return $qb;
    }
426968
public function updateTemplateSections($id, $sections)
    {
        /** @var $entity \PageBuilder\Entity\Template */
        if ($entity = $this->findObject($id)) {

            /** @var $ts \PageBuilder\Entity\Join\TemplateSection */
            foreach ($entity->getTemplateSections() as $ts) {
                $ts->setIsActive(0);
            }
            if ($ts = $entity->getTemplateSections()) {
                $entity->getTemplateSections()->clear();
            } else {
                $entity->setTemplateSections(new ArrayCollection());
            }
        }

        foreach ($sections as $key => $v) {
            $order = $key;
            if ($entry = $this->getEntityManager()->getRepository('PageBuilder\Entity\Join\TemplateSection')
                ->findOneBy(['templateId' => $id, 'sectionId' => $v])
            ) {
                $entry->setSortOrder($order);
                $entry->setIsActive(1);
            } elseif ($section = $this->getEntityManager()->getRepository('PageBuilder\Entity\Section')->find($v)
            ) {
                $entry = new TemplateSection();
                $entry->setSectionId($section);
                $entry->setTemplateId($entity);
                $entry->setSortOrder($order);
                $entry->setIsActive(1);
            }
            $entity->getTemplateSections()->add($entry);
        }

        return $this->save($entity);
    }
776645
public function getPageThemeById($id, $mode = AbstractQuery::HYDRATE_OBJECT)
    {
        $qb = $this->getEntityManager()->createQueryBuilder();
        /** @var $query \Doctrine\ORM\Query */

        $query = $qb->select('e, m')
            ->from($this->getEntity(), 'e')
            ->innerJoin('e.pageId', 'm')
            ->where('e.id = :id')
            ->setMaxResults(1)
            ->setParameter('id', $id)
            ->getQuery();

        return $query->getOneOrNullResult($mode);
    }