dev-master
9999999-devNeo4jPHP OGM Module for Zend Framework 2
The Requires
- php >=5.3.3
- zendframework/zendframework 2.3.*
- doctrine/doctrine-orm-module 0.*
- everyman/neo4jphp dev-master
- hirevoice/neo4jphp-ogm dev-master
Wallogit.com
2017 © Pedro Peláez
Neo4jPHP OGM Module for Zend Framework 2
Intended for use with Neo4jPHP Object Graph Mapper, integrates Neo4jPHP OGM with Zend Framework 2 quickly and easily., (*1)
Install with Composer, see getcomposer.org., (*2)
{
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.3.*",
"doctrine/doctrine-orm-module": "0.*",
"everyman/neo4jphp": "dev-master",
"hirevoice/neo4jphp-ogm": "dev-master",
"opensoftstudio/neo4j-ogm-module": "dev-master"
}
}
php composer.phar install
Then add DoctrineModule, DoctrineORMModule and Neo4jOGMModule to your config/application.config.php and create directory
data/Neo4jOGMModule/Proxy and make sure your application has write access to it., (*3)
To disable proxy regeneration on each request or to use a cached instance of doctrine's annotation reader, add to your module/config/module.config.php. Neo4jOGMModule is deployed with proxy regeneration enabled and annotation reader disabled., (*4)
<?php
return array(
'neo4j' => array(
'entitymanager' => array(
'ogm_default' => array(
// 'debug' => true, // Force proxy regeneration on each request
// 'annotation_reader' => false,
),
),
),
);
Connection parameters to your Neo4j database can be defined in your config/autoload/local.php configuration:, (*5)
<?php
return array(
'neo4j' => array(
'connection' => array(
'ogm_default' => array(
'params' => array(
'transport' => 'curl', // or 'stream'
'host' => 'localhost',
'port' => 7474,
//'username' => null,
//'password' => null,
),
),
),
),
);
To access the entity manager, use the main service locator:, (*6)
$em = $this->getServiceLocator()->get('neo4j.entitymanager.ogm_default');
$em = $this->getServiceLocator()->get('Neo4j\OGM\EntityManager');
Neo4jPHP OGM Module for Zend Framework 2