protected function filterCompare($field, $details, $label, $message) {
        if (isset($details['value'])) {
            $value = $details['value'];
            $secondLabel = '';
        } else {
            $value = $this->getValue($details['column']);
            $secondLabel = isset($this->labels[$details['column']]) ? $this->labels[$details['column']] : ucwords(str_replace('_', ' ', $details['column']));
        }

        if (!isset($details['sign']) || '==' == $details['sign']) {
            if ($this->getValue($field) == $value) {
                return true;
            }
            throw new \Exception($message ? $message : $this->translate(isset($details['value']) ? "Invalid value!" : "$label can't be different than $secondLabel!"));
        } else {
            $result = eval("return \$this->getValue(\$field) $details[sign] \$value");
            if ($result) {
                return true;
            }
            throw new \Exception($message ? $message : $this->translate("Invalid value!"));
        }
    }
protected function filterCompare($field, $details, $label, $message) {
        if (isset($details['value'])) {
            $value = $details['value'];
            $secondLabel = '';
        } else {
            $value = $this->getValue($details['column']);
            $secondLabel = isset($this->labels[$details['column']]) ? $this->labels[$details['column']] : ucwords(str_replace('_', ' ', $details['column']));
        }

        if (!isset($details['sign']) || '==' == $details['sign']) {
            if ($this->getValue($field) == $value) {
                return true;
            }
            throw new \Exception($message ? $message : $this->translate(isset($details['value']) ? "Invalid value!" : "$label can't be different than $secondLabel!"));
        } else {
            $result = eval("return \$this->getValue(\$field) $details[sign] \$value");
            if ($result) {
                return true;
            }
            throw new \Exception($message ? $message : $this->translate("Invalid value!"));
        }
    }
protected function filterCompare ( $ field , $ details , $ label , $ message ) { if ( isset ( $ details [ 'value' ] ) ) { $ value = $ details [ 'value' ] ; $ secondLabel = '' ; } else { $ value = $ this -> getValue ( $ details [ 'column' ] ) ; $ secondLabel = isset ( $ this -> labels [ $ details [ 'column' ] ] ) ? $ this -> labels [ $ details [ 'column' ] ] : ucwords ( str_replace ( '_' , ' ' , $ details [ 'column' ] ) ) ; } if ( ! isset ( $ details [ 'sign' ] ) || '==' == $ details [ 'sign' ] ) { if ( $ this -> getValue ( $ field ) == $ value ) { return true ; } throw new \ Exception ( $ message ? $ message : $ this -> translate ( isset ( $ details [ 'value' ] ) ? "Invalid value!" : "$label can't be different than $secondLabel!" ) ) ; } else { $ result = eval ( "return \$this->getValue(\$field) $details[sign] \$value" ) ; if ( $ result ) { return true ; } throw new \ Exception ( $ message ? $ message : $ this -> translate ( "Invalid value!" ) ) ; } }
Compare two fields or a field with a static value.
@param string $field
@param string [string] $details
@param string $label
@param string $message
@return bool
@throws \Exception
Compare two fields or a field with a static value .