本文整理汇总了PHP中Magento\Customer\Api\GroupManagementInterface::isReadonly方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupManagementInterface::isReadonly方法的具体用法?PHP GroupManagementInterface::isReadonly怎么用?PHP GroupManagementInterface::isReadonly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Customer\Api\GroupManagementInterface
的用法示例。
在下文中一共展示了GroupManagementInterface::isReadonly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _construct
/**
* Update Save and Delete buttons. Remove Delete button if group can't be deleted.
*
* @return void
*/
protected function _construct()
{
parent::_construct();
$this->_objectId = 'id';
$this->_controller = 'adminhtml_group';
$this->_blockGroup = 'Magento_Customer';
$this->buttonList->update('save', 'label', __('Save Customer Group'));
$this->buttonList->update('delete', 'label', __('Delete Customer Group'));
$groupId = $this->coreRegistry->registry(RegistryConstants::CURRENT_GROUP_ID);
if (!$groupId || $this->groupManagement->isReadonly($groupId)) {
$this->buttonList->remove('delete');
}
}
示例2: testIsReadonlyWithInvalidGroupId
/**
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
*/
public function testIsReadonlyWithInvalidGroupId()
{
$testGroup = ['id' => 4, 'code' => 'General', 'tax_class_id' => 3, 'tax_class_name' => 'Retail Customer'];
$this->groupManagement->isReadonly($testGroup['id']);
}