/** * Storage collection * * @param string $path Path to the directory * @return \Magento\Cms\Model\Wysiwyg\Images\Storage\Collection */ public function getCollection($path = null) { /** @var \Magento\Cms\Model\Wysiwyg\Images\Storage\Collection $collection */ $collection = $this->_storageCollectionFactory->create(); if ($path !== null) { $collection->addTargetDir($path); } return $collection; }