Ejemplo n.º 1
0
 /**
  * Register field name dependence one from each other by specified values
  *
  * @param string $fieldName
  * @param string $fieldNameFrom
  * @param \Magento\Config\Model\Config\Structure\Element\Dependency\Field|string $refField
  * @return \Magento\Backend\Block\Widget\Form\Element\Dependence
  */
 public function addFieldDependence($fieldName, $fieldNameFrom, $refField)
 {
     if (!is_object($refField)) {
         /** @var $refField \Magento\Config\Model\Config\Structure\Element\Dependency\Field */
         $refField = $this->_fieldFactory->create(['fieldData' => ['value' => (string) $refField], 'fieldPrefix' => '']);
     }
     $this->_depends[$fieldName][$fieldNameFrom] = $refField;
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * get dependency field.
  *
  * @return Magento\Config\Model\Config\Structure\Element\Dependency\Field [description]
  */
 public function getDependencyField($refField, $negative = false, $separator = ',', $fieldPrefix = '')
 {
     return $this->_fieldFactory->create(['fieldData' => ['value' => (string) $refField, 'negative' => $negative, 'separator' => $separator], 'fieldPrefix' => $fieldPrefix]);
 }