/** * getOptions * * @return array */ protected function getOptions() { $list = parent::getOptions(); if ($this->getParam(static::PARAM_SHOW_ANY_OPTION)) { $list = array('' => static::t('Any profile')) + $list; } return $list; }
/** * getOptions * * @return array */ protected function getOptions() { $availableTypes = $this->getParam(static::PARAM_AVAILABLE_TYPES); $options = parent::getOptions(); $result = array(); foreach ($options as $type => $label) { if (in_array($type, $availableTypes, true)) { $result[$type] = $label; } } return $result; }
/** * Get options list * * @return array */ protected function getOptions() { $list = array(); if ($this->getParam(self::PARAM_USE_CODE_AS_KEY)) { foreach (\XLite\Core\Database::getRepo('XLite\\Model\\Currency')->findAllSortedByName() as $currency) { $list[$currency->getCode()] = $this->getOptionName($currency); } asort($list); } else { $list = parent::getOptions(); } return $list; }
/** * Get options for selector * * @return array */ protected function getOptions() { $list = parent::getOptions(); foreach ($list as $k => $v) { if (!$this->isAllowedOption($k)) { // Remove not allowed option unset($list[$k]); } } if (!$this->isMandatory()) { // Add 'default' option if field is not mandatory $list = array_merge(array('' => static::t('Not specified')), $list); } return $list; }
/** * Get options * * @return array */ protected function getOptions() { $list = parent::getOptions(); if (!$list) { $attribute = $this->getAttribute(); $product = $this->getProduct(); if ($attribute) { if ($product) { foreach ($attribute->getAttributeValue($product) as $attributeValue) { $list[$attributeValue->getId()] = $attributeValue->asString(); } } elseif ($attribute::TYPE_CHECKBOX == $attribute->getType()) { $list[1] = static::t('Yes'); $list[0] = static::t('No'); } elseif ($attribute::TYPE_SELECT == $attribute->getType()) { foreach ($attribute->getAttributeOptions() as $v) { $list[$v->getId()] = $v->getName(); } } } } return $list; }
/** * getOptions * * @return array */ protected function getOptions() { $list = parent::getOptions(); $usedZones = $this->getParam(static::PARAM_USED_ZONES); if ($usedZones) { $usedList = array(); $unUsedList = array(); foreach ($list as $zoneId => $zoneName) { if (isset($usedZones[$zoneId])) { $usedList[$zoneId] = sprintf('%s (%d)', $zoneName, $usedZones[$zoneId]); } else { $unUsedList[$zoneId] = sprintf('%s (%d)', $zoneName, 0); } } if ($usedList) { asort($usedList); $list = $usedList; $list += array(static::SEPARATOR_ID => str_repeat(static::SEPARATOR_SIGN, 10)); asort($usedList); $list += $unUsedList; } } return $list; }
/** * getOptions * * @return array */ protected function getOptions() { return $this->getParam(static::PARAM_SELECT_ONE) ? array('' => $this->getParam(static::PARAM_SELECT_ONE_LABEL)) + parent::getOptions() : parent::getOptions(); }
protected function getOptions() { $options = parent::getOptions(); if (!$this->getOrder() || \XLite\Model\Order::STATUS_AUTHORIZED != $this->getOrder()->getStatus()) { unset($options[\XLite\Model\Order::STATUS_AUTHORIZED]); } return $options; }
/** * getOptions * * @return array */ protected function getOptions() { return array('' => 'Select one...') + parent::getOptions(); }