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


PHP FlowQuery::children方法代码示例

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


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

示例1: propertyNameFilterIsSupported

 /**
  * @test
  */
 public function propertyNameFilterIsSupported()
 {
     $q = new FlowQuery(array($this->node, $this->node->getNode('products')));
     $foundNodes = $q->filter('home')->get();
     $this->assertSame($this->node, $foundNodes[0]);
     $this->assertEquals(1, count($foundNodes));
     $foundNodes = $q->children('x')->get();
     $this->assertEquals(0, count($foundNodes));
 }
开发者ID:testbird,项目名称:neos-development-collection,代码行数:12,代码来源:FilterOperationTest.php

示例2: render

 /**
  * Render the form.
  *
  * @return string
  * @api
  */
 public function render()
 {
     $orderby = 'newsStartDate';
     if (isset($_GET['orderby'])) {
         $orderby = $_GET['orderby'];
     }
     $flowQuery = new FlowQuery(array($this->arguments['node']));
     $query = $flowQuery->children()->children('[instanceof PHLU.NewsAdmin:NewsStructureElement]')->get();
     $newsItemsResult = array();
     foreach ($query as $newsItemNode) {
         $newsItemsResult[] = array('key' => $newsItemNode->getProperty($orderby), 'node' => $newsItemNode);
     }
     $newsItemsResultSorted = $this->sort_arr_of_array($newsItemsResult, 'key', 'asc');
     if ($this->templateVariableContainer->exists($this->arguments['as'])) {
         $this->templateVariableContainer->remove($this->arguments['as']);
     }
     $this->templateVariableContainer->add($this->arguments['as'], $newsItemsResultSorted);
     return $this->renderChildren();
 }
开发者ID:phluzern,项目名称:sites.newsadmin.phlu.ch,代码行数:25,代码来源:PhluLoadNewsItemsViewHelper.php

示例3: multipleCombinedFiltersIsSupported

 /**
  * @test
  */
 public function multipleCombinedFiltersIsSupported()
 {
     $q = new FlowQuery(array($this->node));
     $foundNodes = $q->children('products[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "Products"], about-us[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "About Us"]')->get();
     $this->assertEquals(2, count($foundNodes));
     $foundNodes = $q->children('x[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "Products"], about-us[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "About Us"]')->get();
     $this->assertEquals(1, count($foundNodes));
     $foundNodes = $q->children('products[instanceof TYPO3.TYPO3CR.Testing:X][title *= "Products"], about-us[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "About Us"]')->get();
     $this->assertEquals(1, count($foundNodes));
     $foundNodes = $q->children('x[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "X"], about-us[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "About Us"]')->get();
     $this->assertEquals(1, count($foundNodes));
     $foundNodes = $q->children('products[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "Products"], x[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "About Us"]')->get();
     $this->assertEquals(1, count($foundNodes));
     $foundNodes = $q->children('products[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "Products"], about-us[instanceof TYPO3.TYPO3CR.Testing:X][title *= "About Us"]')->get();
     $this->assertEquals(1, count($foundNodes));
     $foundNodes = $q->children('products[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "Products"], about-us[instanceof TYPO3.TYPO3CR.Testing:Page][title *= "X"]')->get();
     $this->assertEquals(1, count($foundNodes));
 }
开发者ID:mgoldbeck,项目名称:neos-development-collection,代码行数:21,代码来源:ChildrenOperationTest.php


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