Exemple #1
0
 /**
  * Check whether element should be displayed
  *
  * @return bool
  */
 public function isVisible()
 {
     if (!$this->isAllowed()) {
         return false;
     }
     return parent::isVisible();
 }
Exemple #2
0
 /**
  * Probes equivalence of itself against an other node and collects all
  * errors in the passed {@link Notification} object.
  *
  * @param Node         $other  Node to compare against.
  * @param Notification $result Object which collects all equivlanece violations.
  *
  * @return void
  */
 public function probeEquivalence(Node $other, Notification $result)
 {
     parent::probeEquivalence($other, $result);
     if ($this->name !== $other->name) {
         $result->error("Names of rule differs: '%s' != '%s'!", $this->name, $other->name);
     }
 }
 function returnErrorMessage()
 {
     if ($this->reqnumber == 1) {
         //only one field is required
         $this->setErrormessage("Required");
     } elseif ($this->reqnumber > 1) {
         $this->setErrormessage("At least" . $this->reqnumber . "must be selected.");
         //more that 1 at least X must be selected
     }
     return parent::returnErrorMessage();
 }
Exemple #4
0
 /**
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Framework\Module\Manager $moduleManager
  * @param Iterator\Field $childrenIterator
  * @param \Magento\Config\Model\Config\BackendClone\Factory $cloneModelFactory
  * @param Dependency\Mapper $dependencyMapper
  */
 public function __construct(\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Module\Manager $moduleManager, \Magento\Config\Model\Config\Structure\Element\Iterator\Field $childrenIterator, \Magento\Config\Model\Config\BackendClone\Factory $cloneModelFactory, \Magento\Config\Model\Config\Structure\Element\Dependency\Mapper $dependencyMapper)
 {
     parent::__construct($storeManager, $moduleManager, $childrenIterator);
     $this->_cloneModelFactory = $cloneModelFactory;
     $this->_dependencyMapper = $dependencyMapper;
 }
Exemple #5
0
 public function returnErrorMessage()
 {
     $this->setErrormessage("Form Errors: " . $this->error);
     return parent::returnErrorMessage();
 }