public function toPHP()
    {
        $value1 = '$fields->dataFieldByName(\'' . $this->master . '\')->dataValue()';
        $value2 = $this->value;

        if ($operator = $this->phpOperator()) {
            return $value1 . " {$operator} \"$value2\"";
        }

        switch ($this->operator) {
            case 'contains':
                return 'strpos(' . $value1 . '' . ", \"$value2\") !== false";

            case 'Checked':
                return "$value1 == \"1\"";

            case 'Empty':
                return $value1 . '==""';

            case 'hasCheckedOption':
                return 'strpos(' . $value1 . '' . ", \"$value2\") !== false";

            case 'hasCheckedAtLeast':
                return 'substr_count('.$value1.',",") >= ' . $value2;

            case 'hasCheckedLessThan':
                return 'substr_count('.$value1.',",") <= ' . $value2;

            default:
                throw new Exception("ValidationLogicCriteria: php operator \"$this->operator\" not configured.");
        }
    }
public function toPHP()
    {
        $value1 = '$fields->dataFieldByName(\'' . $this->master . '\')->dataValue()';
        $value2 = $this->value;

        if ($operator = $this->phpOperator()) {
            return $value1 . " {$operator} \"$value2\"";
        }

        switch ($this->operator) {
            case 'contains':
                return 'strpos(' . $value1 . '' . ", \"$value2\") !== false";

            case 'Checked':
                return "$value1 == \"1\"";

            case 'Empty':
                return $value1 . '==""';

            case 'hasCheckedOption':
                return 'strpos(' . $value1 . '' . ", \"$value2\") !== false";

            case 'hasCheckedAtLeast':
                return 'substr_count('.$value1.',",") >= ' . $value2;

            case 'hasCheckedLessThan':
                return 'substr_count('.$value1.',",") <= ' . $value2;

            default:
                throw new Exception("ValidationLogicCriteria: php operator \"$this->operator\" not configured.");
        }
    }
public function toPHP ( ) { $ value1 = '$fields->dataFieldByName(\'' . $ this -> master . '\')->dataValue()' ; $ value2 = $ this -> value ; if ( $ operator = $ this -> phpOperator ( ) ) { return $ value1 . " {$operator} \"$value2\"" ; } switch ( $ this -> operator ) { case 'contains' : return 'strpos(' . $ value1 . '' . ", \"$value2\") !== false" ; case 'Checked' : return "$value1 == \"1\"" ; case 'Empty' : return $ value1 . '==""' ; case 'hasCheckedOption' : return 'strpos(' . $ value1 . '' . ", \"$value2\") !== false" ; case 'hasCheckedAtLeast' : return 'substr_count(' . $ value1 . ',",") >= ' . $ value2 ; case 'hasCheckedLessThan' : return 'substr_count(' . $ value1 . ',",") <= ' . $ value2 ; default : throw new Exception ( "ValidationLogicCriteria: php operator \"$this->operator\" not configured." ) ; } }
Returns a string of php code to be evaluated

@return string
Returns a string of php code to be evaluated