_blockCollectionFactory = $blockCollectionFactory; } /** * {@inheritdoc} */ public function toOptionArray() { if ( !$this->_options ) { $this->_options = []; $colection = $this->_blockCollectionFactory->create()->load(); foreach ( $colection as $block ) { $this->_options[] = [ 'value' => $block->getIdentifier(), 'label' => $block->getTitle() ]; } array_unshift( $this->_options, [ 'value' => '', 'label' => __( 'Please select a static block.' ) ] ); } return $this->_options; } }