Prado\Web\UI\WebControls\TCompareValidator::getComparisonValues PHP Method

getComparisonValues() protected method

Parse the pair of values into the appropriate value type.
protected getComparisonValues ( $value1, $value2 ) : array
return array appropriate type of the value pair, array($value1, $value2);
    protected function getComparisonValues($value1, $value2)
    {
        switch ($this->getDataType()) {
            case TValidationDataType::Integer:
                return array(intval($value1), intval($value2));
            case TValidationDataType::Float:
                return array(floatval($value1), floatval($value2));
            case TValidationDataType::Date:
                $dateFormat = $this->getDateFormat();
                if ($dateFormat !== '') {
                    $formatter = new TSimpleDateFormatter($dateFormat);
                    return array($formatter->parse($value1), $formatter->parse($value2));
                } else {
                    return array(strtotime($value1), strtotime($value2));
                }
        }
        return array($value1, $value2);
    }