/** * Prepare value * @param array|string $value * @param bool $exact * @return array|mixed */ protected function _prepareValue($value, $exact = false) { $value = parent::_prepareValue($value); $values = array(); if (!empty($value['range-date']) || !empty($value['range'])) { $value = array($value); } foreach ($value as $val) { if ($this->_isDate($val)) { $tmp = $val['range-date']; } elseif (is_string($val) && strpos($val, '/')) { $tmp = explode('/', $val); } else { if (is_string($val['range']) && strpos($val['range'], '/')) { $tmp = explode('/', $val['range']); } else { $tmp = $val['range']; } } if ($this->_isDate($val)) { $values[] = array($this->app->jbdate->toMysql($tmp[0]), $this->app->jbdate->toMysql($tmp[1])); } else { $values[] = array(JString::trim($tmp[0]), JString::trim($tmp[1])); } } return $values; }
/** * @param Element $element * @param int $applicationId * @param string $itemType */ public function __construct(Element $element, $applicationId, $itemType) { parent::__construct($element, $applicationId, $itemType); $this->money = $this->app->jbmoney; $this->helper = $this->app->jbprice; $this->_currency = JBModelConfig::model()->getCurrency(); }
/** * @param array|string $value * @param bool $exact * @return array|mixed */ protected function _prepareValue($value, $exact = false) { return parent::_prepareValue($value, $exact); }