46 \
Magento\Framework\Escaper $escaper,
48 \
Magento\Framework\Data\Collection\AbstractDb $resourceCollection =
null,
51 $this->_escaper = $escaper;
111 if (
$type ===
null) {
114 if (
$type == self::TYPE_TEXT || !strlen((
string)$this->
getData(
'html_value'))) {
117 if (
$type == self::TYPE_HTML) {
122 return $this->
getData(
'html_value');
132 if ($this->getCode() && $this->getName()) {
135 return __(
'Variable Code must be unique.');
139 return __(
'Validation has failed.');
155 'value' =>
'{{customVar code=' .
$variable[
'value'] .
'}}',
156 'label' =>
__(
'%1', $this->_escaper->escapeHtml(
$variable[
'label'])),
159 if ($withGroup && $variables) {
160 $variables = [[
'label' =>
__(
'Custom Variables'),
'value' => $variables]];
getData($key='', $index=null)
getVariablesOptionArray($withGroup=false)
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Escaper $escaper, \Magento\Variable\Model\ResourceModel\Variable $resource, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])