PHP code example of doctrine / orientdb-odm

1. Go to this page and download the library: Download doctrine/orientdb-odm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

doctrine / orientdb-odm example snippets


$parameters = Doctrine\OrientDB\Binding\BindingParameters::create('http://admin:[email protected]:2480/demo');
$orient = new Doctrine\OrientDB\Binding\HttpBinding($parameters);
$output = $orient->query("SELECT FROM Address");

foreach ($output->getResult() as $address) {
    var_dump($address->street);
}

use Doctrine\OrientDB\Query\Query;

$query = new Query();
$query->from(array('users'))->where('username = ?', "admin");

echo $query->getRaw();      // SELECT FROM users WHERE username = "admin"

use Doctrine\OrientDB\Query\Command\Select;

$select = new Select(array('users'));
echo $select->getRaw();     // SELECT FROM users

php ./test/Integration/fixtures/load.php