src/Module/Aerospike.php
public function haveInAerospike($key, $value, $ttl = 0)
    {
        $akey  = $this->buildKey($key);
        $bins = ['value' => $value];

        $status = $this->aerospike->put(
            $akey,
            $bins,
            $ttl,
            [\Aerospike::OPT_POLICY_KEY => \Aerospike::POLICY_KEY_SEND]
        );

        if ($status != \Aerospike::OK) {
            $this->fail(
                strtr(
                    "[:errno:] Unable to store ':key:' to the database: :error:",
                    [
                        ':errno:' => $this->aerospike->errorno(),
                        ':key:'   => $key,
                        ':error:' => $this->aerospike->error()
                    ]
                )
            );
        }

        $this->keys[] = $akey;
        $this->debugSection('Aerospike', [$key, $value]);

        return $akey;
    }
public function haveInAerospike($key, $value, $ttl = 0)
    {
        $akey  = $this->buildKey($key);
        $bins = ['value' => $value];

        $status = $this->aerospike->put(
            $akey,
            $bins,
            $ttl,
            [\Aerospike::OPT_POLICY_KEY => \Aerospike::POLICY_KEY_SEND]
        );

        if ($status != \Aerospike::OK) {
            $this->fail(
                strtr(
                    "[:errno:] Unable to store ':key:' to the database: :error:",
                    [
                        ':errno:' => $this->aerospike->errorno(),
                        ':key:'   => $key,
                        ':error:' => $this->aerospike->error()
                    ]
                )
            );
        }

        $this->keys[] = $akey;
        $this->debugSection('Aerospike', [$key, $value]);

        return $akey;
    }
public function haveInAerospike ( $ key , $ value , $ ttl = 0 ) { $ akey = $ this -> buildKey ( $ key ) ; $ bins = [ 'value' => $ value ] ; $ status = $ this -> aerospike -> put ( $ akey , $ bins , $ ttl , [ \ Aerospike :: OPT_POLICY_KEY => \ Aerospike :: POLICY_KEY_SEND ] ) ; if ( $ status != \ Aerospike :: OK ) { $ this -> fail ( strtr ( "[:errno:] Unable to store ':key:' to the database: :error:" , [ ':errno:' => $ this -> aerospike -> errorno ( ) , ':key:' => $ key , ':error:' => $ this -> aerospike -> error ( ) ] ) ) ; } $ this -> keys [ ] = $ akey ; $ this -> debugSection ( 'Aerospike' , [ $ key , $ value ] ) ; return $ akey ; }
Inserts data into Aerospike database.

This data will be erased after the test.

```php
<?php
$I->haveInAerospike('users', ['name' => 'miles', 'email' => 'miles@davis.com']);
?>
```

@param string $key  Key
@param mixed $value Value
@param int $ttl     The time-to-live in seconds for the record. [Optional]

@return array
Inserts data into Aerospike database .