Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Multiselect.php
Go to the documentation of this file.
1 <?php
7 
11 
13 {
19  protected $_options;
20 
25  protected $_groupManagement;
26 
31  protected $_converter;
32 
36  private $groupSourceLoggedInOnly;
37 
43  public function __construct(
44  GroupManagementInterface $groupManagement,
45  \Magento\Framework\Convert\DataObject $converter,
46  GroupSourceLoggedInOnlyInterface $groupSourceLoggedInOnly = null
47  ) {
48  $this->_groupManagement = $groupManagement;
49  $this->_converter = $converter;
50  $this->groupSourceLoggedInOnly = $groupSourceLoggedInOnly
51  ?: ObjectManager::getInstance()->get(GroupSourceLoggedInOnlyInterface::class);
52  }
53 
59  public function toOptionArray()
60  {
61  if (!$this->_options) {
62  $this->_options = $this->groupSourceLoggedInOnly->toOptionArray();
63  }
64  return $this->_options;
65  }
66 }
__construct(GroupManagementInterface $groupManagement, \Magento\Framework\Convert\DataObject $converter, GroupSourceLoggedInOnlyInterface $groupSourceLoggedInOnly=null)
Definition: Multiselect.php:43