ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace Olegnax\Athlete2\Model\Config\Settings;
use Magento\Cms\Model\ResourceModel\Block\CollectionFactory;
use Magento\Framework\Option\ArrayInterface;
class Blocks implements ArrayInterface {
protected $_options;
/**
* Block collection factory
*
* @var CollectionFactory
*/
protected $_blockCollectionFactory;
/**
* Construct
*
* @param CollectionFactory $blockCollectionFactory
*/
public function __construct( CollectionFactory $blockCollectionFactory ) {
$this->_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;
}
}