Cassandra\TimestampIntegrationTest::insert PHP Метод

insert() приватный Метод

NOTE: For batch statement the key and value should be null.
private insert ( cassandra\Session $session, cassandra\Statement $statement, integer $key = null, integer $value = null, mixed $timestamp = null )
$session cassandra\Session Session to use when executing statement
$statement cassandra\Statement Statement to execute
$key integer Key to insert value into (default: null)
$value integer Value being set (default: null)
$timestamp mixed Timestamp to set in execution options (default: null)
    private function insert(Session $session, Statement $statement, $key = null, $value = null, $timestamp = null)
    {
        // Create the parameters that make up the execution options
        $parameters = array();
        // Determine if the key and/or value should be added as arguments
        if (isset($key) || isset($value)) {
            // Create the arguments array for the parameters
            $arguments = array();
            if (isset($key)) {
                $arguments["key"] = $key;
            }
            if (isset($value)) {
                $arguments["value_int"] = $value;
            }
            // Assign the arguments to the parameters
            $parameters["arguments"] = $arguments;
        }
        // Determine if the timestamp should be added
        if (isset($timestamp)) {
            $parameters["timestamp"] = $timestamp;
        }
        // Insert values into the table
        $options = new ExecutionOptions($parameters);
        $session->execute($statement, $options);
    }