src/Google/AdsApi/AdManager/Util/v201805/Pql.php
public static function toString(Value $value)
    {
        if ($value instanceof BooleanValue) {
            return $value->getValue() ? 'true' : 'false';
        } elseif ($value instanceof NumberValue || $value instanceof TextValue) {
            return strval($value->getValue());
        } elseif ($value instanceof DateTimeValue) {
            return $value->getValue() !== null
                ? AdManagerDateTimes::toDateTimeString($value->getValue()) : '';
        } elseif ($value instanceof DateValue) {
            return AdManagerDates::toDateString($value->getValue());
        } elseif ($value instanceof SetValue) {
            $pqlValues = $value->getValues();
            if ($pqlValues !== null) {
                $valuesAsStrings = [];
                foreach ($pqlValues as $pqlValue) {
                    $valuesAsStrings[] = self::toString($pqlValue);
                }

                return implode(',', $valuesAsStrings);
            } else {
                return '';
            }
        } else {
            throw new InvalidArgumentException(
                sprintf('Unsupported value type [%s]', get_class($value))
            );
        }
    }
public static function toString(Value $value)
    {
        if ($value instanceof BooleanValue) {
            return $value->getValue() ? 'true' : 'false';
        } elseif ($value instanceof NumberValue || $value instanceof TextValue) {
            return strval($value->getValue());
        } elseif ($value instanceof DateTimeValue) {
            return $value->getValue() !== null
                ? AdManagerDateTimes::toDateTimeString($value->getValue()) : '';
        } elseif ($value instanceof DateValue) {
            return AdManagerDates::toDateString($value->getValue());
        } elseif ($value instanceof SetValue) {
            $pqlValues = $value->getValues();
            if ($pqlValues !== null) {
                $valuesAsStrings = [];
                foreach ($pqlValues as $pqlValue) {
                    $valuesAsStrings[] = self::toString($pqlValue);
                }

                return implode(',', $valuesAsStrings);
            } else {
                return '';
            }
        } else {
            throw new InvalidArgumentException(
                sprintf('Unsupported value type [%s]', get_class($value))
            );
        }
    }
public static function toString ( Value $ value ) { if ( $ value instanceof BooleanValue ) { return $ value -> getValue ( ) ? 'true' : 'false' ; } elseif ( $ value instanceof NumberValue || $ value instanceof TextValue ) { return strval ( $ value -> getValue ( ) ) ; } elseif ( $ value instanceof DateTimeValue ) { return $ value -> getValue ( ) !== null ? AdManagerDateTimes :: toDateTimeString ( $ value -> getValue ( ) ) : '' ; } elseif ( $ value instanceof DateValue ) { return AdManagerDates :: toDateString ( $ value -> getValue ( ) ) ; } elseif ( $ value instanceof SetValue ) { $ pqlValues = $ value -> getValues ( ) ; if ( $ pqlValues !== null ) { $ valuesAsStrings = [ ] ; foreach ( $ pqlValues as $ pqlValue ) { $ valuesAsStrings [ ] = self :: toString ( $ pqlValue ) ; } return implode ( ',' , $ valuesAsStrings ) ; } else { return '' ; } } else { throw new InvalidArgumentException ( sprintf ( 'Unsupported value type [%s]' , get_class ( $ value ) ) ) ; } }
Creates a string from the Value.

@param Value $value the value to convert
@return string the string representation of the value
@throws InvalidArgumentException if value cannot be converted
Creates a string from the Value .