_value = $value; } } /** * Get SQL for this. * * @param GF_Query $query The query. * @param string $delimiter The delimiter for arrays. * * @return string The SQL. */ public function sql( $query, $delimiter = '' ) { global $wpdb; if ( is_string( $this->value ) ) { $value = trim( json_encode( $this->value ), '"' ); $value = str_replace( '\\', '\\\\', $value ); return $wpdb->prepare( '%s', $value ); } return ''; } /** * Proxy read-only values. */ public function __get( $key ) { switch ( $key ) : case 'value': return $this->_value; endswitch; } public function __isset( $key ) { return in_array( $key, array( 'value' ) ); } }