本文整理汇总了PHP中Magento\Customer\Api\GroupManagementInterface::getLoggedInGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupManagementInterface::getLoggedInGroups方法的具体用法?PHP GroupManagementInterface::getLoggedInGroups怎么用?PHP GroupManagementInterface::getLoggedInGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Customer\Api\GroupManagementInterface
的用法示例。
在下文中一共展示了GroupManagementInterface::getLoggedInGroups方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetLoggedInGroups
public function testGetLoggedInGroups()
{
$loggedInGroups = $this->groupManagement->getLoggedInGroups();
foreach ($loggedInGroups as $group) {
$this->assertNotEquals(GroupManagement::NOT_LOGGED_IN_ID, $group->getId());
$this->assertNotEquals(GroupManagement::CUST_GROUP_ALL, $group->getId());
}
}
示例2: toOptionArray
/**
* Retrieve customer groups as array
*
* @return array
*/
public function toOptionArray()
{
if (!$this->_options) {
$groups = $this->_groupManagement->getLoggedInGroups();
$this->_options = $this->_converter->toOptionArray($groups, 'id', 'code');
}
return $this->_options;
}
示例3: toOptionArray
/**
* @return array
*/
public function toOptionArray()
{
if (!$this->_options) {
$groups = $this->_groupManagement->getLoggedInGroups();
$this->_options = $this->_converter->toOptionArray($groups, 'id', 'code');
array_unshift($this->_options, ['value' => '', 'label' => __('-- Please Select --')]);
}
return $this->_options;
}