Download the PHP package explosivebit/yii2-arangodb without Composer
On this page you can find all versions of the php package explosivebit/yii2-arangodb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download explosivebit/yii2-arangodb
More information about explosivebit/yii2-arangodb
Files in explosivebit/yii2-arangodb
Package yii2-arangodb
Short Description Yii2 arangodb components
License GPL-3.0+
Informations about the package yii2-arangodb
ArangoDb Extension for Yii 2
This extension provides the ArangoDB integration for the Yii2 framework.
Installation
This extension requires ArangoDB PHP Extension
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json.
General Usage
To use this extension, simply add the following code in your application configuration:
Using the connection instance you may access databases, collections and documents.
To perform "find" queries, you should use [[\explosivebit\arangodb\Query]]:
Using the ArangoDB ActiveRecord
This extension provides ActiveRecord solution similar ot the [[\yii\db\ActiveRecord]].
To declare an ActiveRecord class you need to extend [[\explosivebit\arangodb\ActiveRecord]] and
implement the collectionName
and 'attributes' methods:
Note: collection primary key name ('_key') should be always explicitly setup as an attribute.
You can use [[\yii\data\ActiveDataProvider]] with [[\explosivebit\arangodb\Query]] and [[\explosivebit\arangodb\ActiveQuery]]:
Using Migrations
ArangoDB migrations are managed via [[explosivebit\arangodb\console\controllers\MigrateController]], which is an analog of regular [[\yii\console\controllers\MigrateController]].
In order to enable this command you should adjust the configuration of your console application:
Below are some common usages of this command:
Once migration created, you can configure the migration:
When you start the migration as in the example below, you create a normal document collection with the migration name, you need to add an additional parameter Type => 3
to create the edge collection
. Example of such a query: $this-> createCollection ('services', ['Type' => 3] );
If you want to create a document collection, then delete the 'Type' => 3
or replace the number 3 with 2.
Using Debug Panel
Add ArangoDb panel to your yii\debug\Module configuration