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