本文整理匯總了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);
}