public function onBeforeRender($field) { if (!$this->validationLogicCriteria) { return; } $masters = array_unique($this->validationLogicCriteria->getMasterList()); if (count($masters)) { $this->owner->setAttribute('data-validation-logic-masters', implode(',', $masters)); $this->owner->setAttribute('data-validation-logic-eval', $this->validationLogicCriteria->toScript()); } }
/** * Ends the chaining and returns the parent object, either {@link ValidationLogicCriteria} or {@link FormField} * * @return FormField/ValidationLogicCriteria */ public function end() { if ($this->parent) { $this->parent->addCriterion($this); } return $this->slave; }
public function validateIf($master) { return $this->validationLogicCriteria = ValidationLogicCriteria::create($this->owner, $master); }