Tag Archives: PHP

Getting started with ArangoDB and Symfony 2 – part 1

This is part 1 (of 4) of an introduction to the use of ArangoDB together with Symfony 2. You’ll find the links to the other parts of this tutorial at the end of this text. In this tutorial we will implement a very simple movie database as an example of how to use ArangoDB together with Symfony 2. We assume for the tutorial that you know the basic concepts of Symfony2. No prior ArangoDB knowledge is required. The demo shows how to create, edit, update and delete movies, how to select a list of movies from the database in two different ways. We’ll use the simple query API for most examples. The “search for a topic” feature uses ArangoDB’s query language (AQL), a convenient sql-like way to query ArangoDB. You can download the completed demo at Github.

Posted in API, php | Tagged , , , | Comments Off

Getting started with ArangoDB and Symfony 2 – part 2

This is part 2 (of 4) of an introduction to the use of ArangoDB together with Symfony 2. You’ll find the links to the other parts of this tutorial at the end of this text. You can download the completed demo at Github. The data structure Our app deals with movies: each movie has a title, a year of release and it is assigned to a genre. Each movie deals with none, one or many topics. In a relational database we would probably create a table movie and another table topic and join them with a shared movie id. ArangoDB follows like other document stores the “aggregate model” approach: In short terms this means that you should put data that is often needed together into one document. Remember: documents are a bit like rows in the relation world; in nosql world they can have a nested structure.

Posted in API, php | Tagged , , , | Leave a comment

Getting started with ArangoDB and Symfony 2 – part 3

This is part 3 (of 4) of an introduction to the use of ArangoDB together with Symfony 2. You’ll find the links to the other parts of this tutorial at the end of this text. You can download the completed demo at Github. Working with forms The next example shows the use of ArangoDB with Symfony’s form component. This is how our form will look like. The topics are represented as a text field and the user is required to separate them by commas. This delivers questionable user experience, but leads to an interesting question: how can we transform our topics array from our movie document to a text field? And: we’ll need it at least two times, both for creating and editing movies.

Posted in API, php | Tagged , , , | Leave a comment

Getting started with ArangoDB and Symfony 2 – part 4

This is part 4 (of 4) of an introduction to the use of ArangoDB together with Symfony 2. You’ll find the links to the other parts of this tutorial at the end of this text. You can download the completed demo at Github. Extending Arangodb\Document The next thing we want to improve are all those noisy set calls in the controller: 1 2 3 4 5 6 7 8 // src/Triagens/ArangodbBundle/Controller/DefaultController.php if ($form->isValid()) { $movie = new ArangoDocument(); $movie->set("title",$form->get("title")->getData()); $movie->set("released",$form->get("released")->getData()); $movie->set("genre",$form->get("genre")->getData()); // and so on … my eyes hurt! }

Posted in API, php | Tagged , , , | 2 Comments

The API Implementors Gathering

Dear API Implementors, We want to make it simpler for you to keep up with the development of ArangoDB. We therefore created a dedicated place for all API implementors. If you are implementing a Driver, ODM or database access tool for ArangoDB, this is the right place for you. In addition to sharing information about the changing API, we want to discuss patterns and ideas with each other. The team behind ArangoDB will announce API changes and enhancements in the issues of this project, so you have one place to get all the up to date information. Apart from that, the community is independent from the ArangoDB team. We want to make this a central, open place for all API implementors. So if you want to be part of this group, just introduce yourself and we will add you to the list. Then just watch the Repository to get all information in your inbox. We already have the people behind the PHP and Ruby drivers on board. We’re looking forward to discussing with you and build a multi-programming language community around ArangoDB. So join us.

Posted in API | Tagged , | Leave a comment

Tutorial for ArangoDB’s PHP API published

Note: We changed the name of the database in May 2012. AvocadoDB is now called ArangoDB. Hey there, short notice: Jan has written a tutorial on how to use the PHP API for AvocadoDB (note: this is “just” the API for the REST interface, it does not cover yet the upcoming query language). You can find both the PHP API and the tutorial on Github. We are making progress with other languages as well… but that’s something for another blog post (cliffhanger ).

Posted in API, php | Tagged , | Leave a comment