ltsecurityinc安防产品在线商城代码
This commit is contained in:
+72
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace JR\NetSuite\Model\Config\Source;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\SourceInterface;
|
||||
use Magento\Framework\Data\OptionSourceInterface;
|
||||
|
||||
/**
|
||||
* Product status functionality model
|
||||
*
|
||||
* @api
|
||||
* @since 100.0.2
|
||||
*/
|
||||
class IsActive extends AbstractSource implements SourceInterface, OptionSourceInterface
|
||||
{
|
||||
/**#@+
|
||||
* Product Status values
|
||||
*/
|
||||
const STATUS_ENABLED = 1;
|
||||
|
||||
const STATUS_DISABLED = 0;
|
||||
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Retrieve Visible Status Ids
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function getVisibleStatusIds()
|
||||
{
|
||||
return [self::STATUS_ENABLED];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Saleable Status Ids
|
||||
* Default Product Enable status
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function getSaleableStatusIds()
|
||||
{
|
||||
return [self::STATUS_ENABLED];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
return [self::STATUS_ENABLED => __('Enabled'), self::STATUS_DISABLED => __('Disabled')];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve option array with empty value
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
$result = [];
|
||||
|
||||
foreach (self::getOptionArray() as $index => $value) {
|
||||
$result[] = ['value' => $index, 'label' => $value];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user