public function toDatabase($value, Driver $driver)
    {
        if ($value === null || is_string($value)) {
            return $value;
        }

        return serialize($value);
    }
public function toDatabase($value, Driver $driver)
    {
        if ($value === null || is_string($value)) {
            return $value;
        }

        return serialize($value);
    }
public function toDatabase ( $ value , Driver $ driver ) { if ( $ value === null || is_string ( $ value ) ) { return $ value ; } return serialize ( $ value ) ; }
Convert a value data into a serialized string.

@param mixed $value The value to convert.
@param \Cake\Database\Driver $driver The driver instance to convert with.

@return string|null
Convert a value data into a serialized string .