本文整理汇总了PHP中Magento\Catalog\Model\Category::move方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::move方法的具体用法?PHP Category::move怎么用?PHP Category::move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Model\Category
的用法示例。
在下文中一共展示了Category::move方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: move
/**
* {@inheritdoc}
*/
public function move($parentId, $afterCategoryId)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'move');
if (!$pluginInfo) {
return parent::move($parentId, $afterCategoryId);
} else {
return $this->___callPlugins('move', func_get_args(), $pluginInfo);
}
}
示例2: testMovePrimaryWorkflow
public function testMovePrimaryWorkflow()
{
$indexer = $this->getMock('stdClass', ['isScheduled']);
$indexer->expects($this->once())->method('isScheduled')->will($this->returnValue(true));
$this->indexerRegistry->expects($this->once())->method('get')->with('catalog_category_product')->will($this->returnValue($indexer));
$parentCategory = $this->getMock('Magento\\Catalog\\Model\\Category', ['getId', 'setStoreId', 'load'], [], '', false);
$parentCategory->expects($this->any())->method('getId')->will($this->returnValue(5));
$parentCategory->expects($this->any())->method('setStoreId')->will($this->returnSelf());
$parentCategory->expects($this->any())->method('load')->will($this->returnSelf());
$this->categoryRepository->expects($this->any())->method('get')->will($this->returnValue($parentCategory));
$store = $this->getMock('Magento\\Store\\Model\\Store', [], [], '', false);
$this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store));
$this->category->setId(3);
$this->category->move(5, 7);
}
示例3: testMoveWrongId
/**
* @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testMoveWrongId()
{
$this->_model->move(100, 0);
}