本文整理汇总了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);
}
示例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;
}
示例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";
}
示例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);
}
示例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);
}
示例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;
}