本文整理汇总了PHP中eZContentOperationCollection::removeAssignment方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentOperationCollection::removeAssignment方法的具体用法?PHP eZContentOperationCollection::removeAssignment怎么用?PHP eZContentOperationCollection::removeAssignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentOperationCollection
的用法示例。
在下文中一共展示了eZContentOperationCollection::removeAssignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRemoveAssignments
/**
* Test to verify that eznode_assignment entres get removed.
*
* @link http://issues.ez.no/15478
*/
public function testRemoveAssignments()
{
$db = eZDB::instance();
$testSet = array();
$folder = new ezpObject( "folder", 2 );
$folder->name = __FUNCTION__;
$folder->publish();
$testSet[] = $folder;
$childOne = new ezpObject( "folder", $folder->mainNode->node_id );
$childOne->name = "ChildOne";
$childOne->publish();
$testSet[] = $childOne;
$childTwo = new ezpObject( "folder", $folder->mainNode->node_id );
$childTwo->name = "ChildTwo";
$childTwo->publish();
$testSet[] = $childTwo;
$subChildOne = new ezpObject( 'article', $childOne->mainNode->node_id );
$subChildOne->title = "SubChild";
$subChildOne->publish();
$testSet[] = $subChildOne;
$subChildTwo = new ezpObject( 'article', $childOne->mainNode->node_id );
$subChildTwo->title = "SubChildOther";
$subChildTwo->publish();
$testSet[] = $subChildTwo;
$subChildThree = new ezpObject( 'article', $childOne->mainNode->node_id );
$subChildThree->title = "SubChildThird";
$subChildThree->publish();
$testSet[] = $subChildThree;
// Let's add another placement here
$newPlacementSubChildOne = $subChildOne->addNode( $childTwo->mainNode->node_id );
$testSet[] = $newPlacementSubChildOne;
// $this->debugBasicNodeInfo( $testSet );
$coId = $newPlacementSubChildOne->attribute( 'contentobject_id' );
eZContentOperationCollection::removeAssignment( $childTwo->mainNode->node_id, $childTwo->id, array( $newPlacementSubChildOne ), false );
$checkSql = "SELECT * FROM eznode_assignment WHERE contentobject_id = {$coId}";
$result = $db->arrayQuery( $checkSql );
// After removing one of the assignments, the number of node
// assignments for the content object should be only one.
$numberOfAssignments = count( $result );
self::assertEquals( 1, $numberOfAssignments, "The number of node assignments are not correct, eznode_assignment table not cleaned up correctly." );
}