public static function create(Connection $connection, $name)
    {
        $payload = [
            self::ENTRY_DATABASE_NAME  => $name,
            self::ENTRY_DATABASE_USERS => [
                [
                    'username' => $connection->getOption(ConnectionOptions::OPTION_AUTH_USER),
                    'passwd'   => $connection->getOption(ConnectionOptions::OPTION_AUTH_PASSWD)
                ]
            ]
        ];

        $response = $connection->post(Urls::URL_DATABASE, $connection->json_encode_wrapper($payload));

        return $response->getJson();
    }
public static function create(Connection $connection, $name)
    {
        $payload = [
            self::ENTRY_DATABASE_NAME  => $name,
            self::ENTRY_DATABASE_USERS => [
                [
                    'username' => $connection->getOption(ConnectionOptions::OPTION_AUTH_USER),
                    'passwd'   => $connection->getOption(ConnectionOptions::OPTION_AUTH_PASSWD)
                ]
            ]
        ];

        $response = $connection->post(Urls::URL_DATABASE, $connection->json_encode_wrapper($payload));

        return $response->getJson();
    }
public static function create ( Connection $ connection , $ name ) { $ payload = [ self :: ENTRY_DATABASE_NAME => $ name , self :: ENTRY_DATABASE_USERS => [ [ 'username' => $ connection -> getOption ( ConnectionOptions :: OPTION_AUTH_USER ) , 'passwd' => $ connection -> getOption ( ConnectionOptions :: OPTION_AUTH_PASSWD ) ] ] ] ; $ response = $ connection -> post ( Urls :: URL_DATABASE , $ connection -> json_encode_wrapper ( $ payload ) ) ; return $ response -> getJson ( ) ; }
creates a database

This creates a new database<br>

@param Connection $connection - the connection to be used
@param string     $name       - the database specification, for example 'myDatabase'

@link https://docs.arangodb.com/HTTP/Database/index.html

@return array $responseArray - The response array.
@throws \ArangoDBClient\Exception
@throws \ArangoDBClient\ClientException
creates a database