protected function castValueImpl($value) { $n = $this->parse($value); if ($n === FALSE) { $currency = new CurrencyDataTypeHandler(); $n = $currency->parse($value); } if ($n === FALSE) { $percent = new PercentDataTypeHandler(); $n = $percent->parse($value); } if ($n === FALSE) { $this->errorCastValue($value); } return $n; }
public function castValue($value) { $adjustedValue = parent::castValue($value); if (!isset($adjustedValue)) { return NULL; } $n = $this->parse($adjustedValue); if ($n === FALSE) { $currency = new CurrencyDataTypeHandler(); $n = $currency->parse($adjustedValue); } if ($n === FALSE) { $percent = new PercentDataTypeHandler(); $n = $percent->parse($adjustedValue); } if ($n === FALSE) { $this->errorCastValue($adjustedValue); } return $n; }