本文整理匯總了PHP中eZNodeAssignment::fetchChildListByVersionStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZNodeAssignment::fetchChildListByVersionStatus方法的具體用法?PHP eZNodeAssignment::fetchChildListByVersionStatus怎麽用?PHP eZNodeAssignment::fetchChildListByVersionStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZNodeAssignment
的用法示例。
在下文中一共展示了eZNodeAssignment::fetchChildListByVersionStatus方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testFetchChildListByVersionStatus
/**
* test fetchChildListByVersionStatus
*/
public function testFetchChildListByVersionStatus()
{
//create object
$top = new ezpObject('article', 2);
$top->name = 'TOP ARTICLE';
$top->publish();
$child = new ezpObject('article', $top->mainNode->node_id);
$child->name = 'THIS IS AN ARTICLE';
$child->publish();
$child2 = new ezpObject('article', $top->mainNode->node_id);
$child2->name = 'THIS IS AN ARTICLE2';
$child2->publish();
$pendingChild = new ezpObject('article', $top->mainNode->node_id);
$pendingChild->name = 'THIS IS A PENDING ARTICLE';
$pendingChild->publish();
$version = $pendingChild->currentVersion();
$version->setAttribute('status', eZContentObjectVersion::STATUS_PENDING);
$version->store();
$idList = array($top->mainNode->node_id);
$arrayResult = eZNodeAssignment::fetchChildListByVersionStatus($idList, eZContentObjectVersion::STATUS_PENDING, false);
$this->assertEquals($pendingChild->id, $arrayResult[0]['contentobject_id']);
$arrayResult = eZNodeAssignment::fetchChildListByVersionStatus($idList, eZContentObjectVersion::STATUS_PUBLISHED, true);
$this->assertEquals($child->id, $arrayResult[0]->attribute('contentobject_id'));
$countResult = eZNodeAssignment::fetchChildCountByVersionStatus($idList, eZContentObjectVersion::STATUS_PENDING);
$this->assertEquals(1, $countResult);
$countResult = eZNodeAssignment::fetchChildCountByVersionStatus($idList, eZContentObjectVersion::STATUS_PUBLISHED);
$this->assertEquals(2, $countResult);
}