-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#94738 add customer groups to nodes (#298)
* #94738 add serialized customer groups field to nodes --------- Co-authored-by: Ola <[email protected]>
- Loading branch information
1 parent
0024ff2
commit 6d8bc3e
Showing
23 changed files
with
450 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Snowdog\Menu\Model; | ||
|
||
use Magento\Customer\Model\Group; | ||
use Magento\Customer\Model\ResourceModel\Group\CollectionFactory as GroupCollectionFactory; | ||
|
||
class CustomerGroupsProvider | ||
{ | ||
/** | ||
* @var GroupCollectionFactory | ||
*/ | ||
private $groupCollectionFactory; | ||
|
||
public function __construct( | ||
GroupCollectionFactory $groupCollectionFactory | ||
) { | ||
$this->groupCollectionFactory = $groupCollectionFactory; | ||
} | ||
|
||
public function getAll() | ||
{ | ||
$customerGroups = []; | ||
|
||
/** @var Group $customerGroup */ | ||
foreach ($this->groupCollectionFactory->create() as $customerGroup) { | ||
$customerGroups[] = [ | ||
'label' => $customerGroup->getCode(), | ||
'value' => $customerGroup->getId() | ||
]; | ||
} | ||
|
||
return $customerGroups; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.