_dataUrl = $url; $this->setRegisterInArrayValidator(false); return $this; } public function getDataUrl() { return $this->_dataUrl; } public function getNotFoundMessage() { $translator = $this->getTranslator(); if (null !== $translator) { return $translator->translate($this->_notFoundMessage); } return $this->_notFoundMessage; } public function setNotFoundMessage($message) { $this->_notFoundMessage = $message; return $this; } public function loadDefaultDecorators() { if ($this->loadDefaultDecoratorsIsDisabled()) { return; } $decorators = $this->getDecorators(); if (empty($decorators)) { $this->addDecorator('JQuery_MultiDataAutocomplete') ->addDecorator('Errors') ->addDecorator('Description', ['tag' => 'p', 'class' => 'description']) ->addDecorator('HtmlTag', ['tag' => 'dd', 'id' => $this->getName() . '-element']) ->addDecorator('Label', ['tag' => 'dt', 'disableFor' => true]); } } public function isValid($value, $context = null) { $isValid = parent::isValid($value, $context); return $isValid; } public function getFullyQualifiedDisplayName() { return $this->_getSystemName($this->getFullyQualifiedName()); } public function getFullyQualifiedTitleName() { return $this->_getSystemName($this->getFullyQualifiedDisplayName()); } protected function _getSystemName($name) { if (false !== ($pos = strrpos($name, '['))) { $pos++; $_name = substr($name, 0, $pos) . '_' . substr($name, $pos); } else { $_name = '_' . $name; } return $_name; } public function getDisplayId() { return $this->_getSystemId($this->getId()); } protected function _getSystemId($id) { if (false !== ($pos = strrpos($id, '-'))) { $pos++; $_id = substr($id, 0, $pos) . '_' . substr($id, $pos); } else { $_id = '_' . $id; } return $_id; } /** * Sets display titles * @param array $titles array('id1' => 'title1', 'id2' => 'title2' ) * @return Qs_Form_Element_MultiDataAutocomplete */ public function setTitles($titles) { $this->_titles = (array) $titles; return $this; } public function getTitles() { return $this->_titles; } public function getValue() { $value = parent::getValue(); return (is_array($value)) ? array_values(array_filter($value)) : []; } }