/** * Set the Control * * @api * @param Control $control Map Info Control * @return static */ public function setControl(Control $control) { $control->checkId(); if ($control instanceof Scriptable) { $control->setScriptEvents(true); } $this->control = $control; return $this; }
/** * Set the Item Control * * @api * @param Control $item Item Control * @return static */ public function setItem(Control $item) { $item->checkId(); if ($item instanceof Scriptable) { $item->setScriptEvents(true); } $this->item = $item; return $this; }
/** * Enable Script Events on the Control if needed * * @return static */ protected function updateScriptEvents() { if (!$this->control || !ScriptLabel::isEventLabel($this->labelName)) { return $this; } if ($this->control instanceof Scriptable) { $this->control->setScriptEvents(true); } return $this; }