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
+47
View File
@@ -0,0 +1,47 @@
<?php
/**
* @author Amasty Team
* @copyright Copyright (c) Amasty (https://www.amasty.com)
* @package Hide Price (Call for Price) for Magento 2
*/
namespace Amasty\HidePrice\Model\Source;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Option\ArrayInterface;
use Magento\Framework\DB\Select;
class CustomForm implements ArrayInterface
{
public const CUSTOMFORM_TABLE = 'amasty_customform_form';
/**
* @var ResourceConnection
*/
private $resource;
public function __construct(ResourceConnection $resource)
{
$this->resource = $resource;
}
/**
* @return array
*/
public function toOptionArray()
{
$options = [];
$connection = $this->resource->getConnection();
$tableName = $this->resource->getTableName(self::CUSTOMFORM_TABLE);
if ($connection->isTableExists($tableName)) {
$select = $connection->select()
->from($tableName)
->reset(Select::COLUMNS)
->columns(['value' => 'form_id', 'label' => 'title']);
$options = $connection->fetchAll($select);
}
return $options;
}
}