当前位置: 首页>>代码示例>>PHP>>正文


PHP FlowQuery::find方法代码示例

本文整理汇总了PHP中TYPO3\Eel\FlowQuery\FlowQuery::find方法的典型用法代码示例。如果您正苦于以下问题:PHP FlowQuery::find方法的具体用法?PHP FlowQuery::find怎么用?PHP FlowQuery::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\Eel\FlowQuery\FlowQuery的用法示例。


在下文中一共展示了FlowQuery::find方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initializeSystemNodes

 /**
  * @return void
  */
 protected function initializeSystemNodes()
 {
     $contentContext = $this->getContentContext(true);
     $flowQuery = new FlowQuery([$contentContext->getNode($this->rootNodePath)]);
     $this->systemNodeIdentifiers = [];
     foreach ($flowQuery->find('[instanceof Nezaniel.SystemNodes:SystemNode]')->get() as $systemNode) {
         $this->initializeSystemNode($systemNode);
     }
     $this->cache->set('systemNodeIdentifiers', $this->systemNodeIdentifiers);
 }
开发者ID:nezaniel,项目名称:systemnodes,代码行数:13,代码来源:SystemNodeService.php

示例2: getList

 /**
  * @return string
  */
 public final function getList()
 {
     $context = $this->contextFactory->create(['workspaceName' => 'live']);
     $flowQuery = new FlowQuery([$context->getRootNode()]);
     $events = $flowQuery->find('[instanceof Nieuwenhuizen.BuJitsuDo:Article]')->get();
     $result['articles'] = [];
     usort($events, function (NodeInterface $a, NodeInterface $b) {
         return $this->sortNodesSelection($a, $b, 'publicationDate', false);
     });
     foreach ($events as $event) {
         $result['articles'][] = $this->buildSingleItemJson($event);
     }
     return $result;
 }
开发者ID:keen-vantage,项目名称:BuJitsuDo.Api,代码行数:17,代码来源:NewsService.php

示例3: repairCommand

 /**
  * Repair votes action
  *
  * Compare number of votes between nodes and vote log and repair, if not dryRun
  *
  * @param boolean $dryRun Don't do anything, but report actions
  * @return string
  */
 public function repairCommand($dryRun = TRUE)
 {
     if ($dryRun) {
         echo "Dry run, not making any changes\n";
     }
     $q = new FlowQuery(array($this->context->getRootNode()));
     $answerNodes = $q->find('[instanceof Sfi.Encult:Answer]')->get();
     foreach ($answerNodes as $answerNode) {
         /** @var \Doctrine\ORM\QueryBuilder $queryBuilder */
         $queryBuilder = $this->entityManager->createQueryBuilder();
         $nodes = $queryBuilder->select('v')->from('Sfi\\Encult\\Domain\\Model\\Vote', 'v')->andWhere('v.answerIdentifier = :answerIdentifier')->setParameters(array('answerIdentifier' => $answerNode->getIdentifier()))->getQuery()->getArrayResult();
         $dbCount = count($nodes);
         $crCount = $answerNode->getProperty('voteCount');
         $path = $answerNode->getPath();
         if ($dbCount !== $crCount) {
             echo "Found mistake for {$path} (db: {$dbCount} vs. cr: {$crCount})\n";
             if (!$dryRun) {
                 echo "Fixed\n";
                 $answerNode->setProperty('voteCount', $dbCount);
             }
         }
     }
     return "Done!\n";
 }
开发者ID:alexkuklin,项目名称:EncultDistr,代码行数:32,代码来源:VoteCommandController.php

示例4: getNewsByOriginalId

 protected function getNewsByOriginalId($id)
 {
     $q = new FlowQuery(array($this->context->getRootNode()));
     return $q->find('[instanceof Sfi.Kateheo:News]')->filter('[originalIdentifier = "' . $id . '"]')->get(0);
 }
开发者ID:psmb,项目名称:KateheoDistr,代码行数:5,代码来源:MigrationCommandController.php

示例5: findByNodeWithInstanceofFilterAppliesAdditionalAttributeFilter

 /**
  * @test
  */
 public function findByNodeWithInstanceofFilterAppliesAdditionalAttributeFilter()
 {
     $q = new FlowQuery(array($this->node));
     $foundNodes = $q->find('[instanceof TYPO3.TYPO3CR.Testing:Text][text*="Twitter"]')->get();
     $this->assertCount(1, $foundNodes);
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:9,代码来源:FindOperationTest.php

示例6: getStorageFolder

 /**
  * Gets a storage folder by type, and creates it if needed
  *
  * @param string $nodeTypeName
  * @param NodeInterface $rootNode
  * @return NodeInterface
  */
 protected function getStorageFolder($nodeTypeName, NodeInterface $rootNode)
 {
     $query = new FlowQuery([$rootNode]);
     $storageFolder = $query->find('[instanceof ' . $nodeTypeName . ']')->get(0);
     if (!$storageFolder instanceof NodeInterface) {
         $storageFolder = $rootNode->createNode(uniqid('node-'), $this->nodeTypeManager->getNodeType($nodeTypeName));
     }
     return $storageFolder;
 }
开发者ID:keen-vantage,项目名称:BuJitsuDo.Api,代码行数:16,代码来源:AbstractDataService.php


注:本文中的TYPO3\Eel\FlowQuery\FlowQuery::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。