niterain / Neo4jPhpOgm by niterain

Brings Neo4J PHP OGM to Laravel4
25
0
2
Package Data
Maintainer Username: niterain
Maintainer Contact: levi@eneservices.com (levi stanley)
Package Create Date: 2013-11-24
Package Last Update: 2013-12-12
Language: PHP
License: MIT
Last Refreshed: 2024-04-30 15:03:08
Package Statistics
Total Downloads: 25
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Allows you to use Neo4j with Laravel4

Installation

Add niterain\Neo4jPhpOgm as a requirement to composer.json:

{
    "require": {
        "niterain/neo4j-php-ogm": "dev-master"
    }
}

Update your packages with composer update or install with composer install.

Once Composer has installed or updated your packages you need to register Neo4jPhpOgm with Laravel. Open up app/config/app.php and find the providers key towards the bottom and add:

'Niterain\Neo4jPhpOgm\Neo4jPhpOgmServiceProvider',

Configuration

Since I like having my config files in one directory, this library checks to see if the settings are in the database.php file in the app/config directory as one of the connections under the 'neo4j' key, but if there isn't one defined, it looks in its local config.php file.

Usage

You add your entities in an Entity folder, from there everything feels much like Doctrine2.

$em = App::make('entityManager');
$user = $em->getRepository('Entity\\User');
$user->add(array('firstName' => 'levi', 'lastName' => 'stanley'));
$em->persist($user);
$em->flush();