Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Page.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Cms\Model\ResourceModel\Page\CollectionFactory;
9 
14 {
18  protected $options;
19 
23  protected $collectionFactory;
24 
28  public function __construct(
29  CollectionFactory $collectionFactory
30  ) {
31  $this->collectionFactory = $collectionFactory;
32  }
33 
39  public function toOptionArray()
40  {
41  if (!$this->options) {
42  $this->options = $this->collectionFactory->create()->toOptionIdArray();
43  }
44  return $this->options;
45  }
46 }
__construct(CollectionFactory $collectionFactory)
Definition: Page.php:28