/** * Return field value * * @return mixed */ public function getValue() { $result = $value = parent::getValue(); $options = $this->getOptions(); if (!(isset($value) && isset($options[$value]))) { $value = array_keys($options); $result = array_shift($value); } return $result; }
/** * getOptions * * @return array */ protected function getOptions() { $list = parent::getOptions(); $list += $this->getCategories(); if ($this->getParam(static::PARAM_DISPLAY_ROOT_CATEGORY)) { $list = array($this->getRootCategoryId() => static::t('Root category')) + $list; } if ($this->getParam(static::PARAM_DISPLAY_ANY_CATEGORY)) { $list = array(static::t('Any category')) + $list; } return $list; }
/** * Get common attributes * * @return array */ protected function getCommonAttributes() { $list = parent::getCommonAttributes(); $list['name'] .= '[]'; return $list; }
/** * Assemble classes * * @param array $classes Classes * * @return array */ protected function assembleClasses(array $classes) { $classes = parent::assembleClasses($classes); $classes[] = 'multiple-selector'; return $classes; }