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


PHP eZContentOperationCollection::removeAssignment方法代码示例

本文整理汇总了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." );
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:60,代码来源:ezcontentoperationcollection_regression.php


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