opensoftstudio / neo4j-ogm-module
Neo4jPHP OGM Module for Zend Framework 2
Installs: 987
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 3
Open Issues: 1
pkg:composer/opensoftstudio/neo4j-ogm-module
Requires
- php: >=5.3.3
- doctrine/doctrine-orm-module: 0.*
- everyman/neo4jphp: dev-master
- hirevoice/neo4jphp-ogm: dev-master
- zendframework/zendframework: 2.3.*
This package is not auto-updated.
Last update: 2025-10-21 12:31:40 UTC
README
Intended for use with Neo4jPHP Object Graph Mapper, integrates Neo4jPHP OGM with Zend Framework 2 quickly and easily.
Quick Start
Install with Composer, see getcomposer.org.
{
"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.
Entity Manager settings
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.
<?php return array( 'neo4j' => array( 'entitymanager' => array( 'ogm_default' => array( // 'debug' => true, // Force proxy regeneration on each request // 'annotation_reader' => false, ), ), ), );
Connection settings
Connection parameters to your Neo4j database can be defined in your config/autoload/local.php configuration:
<?php return array( 'neo4j' => array( 'connection' => array( 'ogm_default' => array( 'params' => array( 'transport' => 'curl', // or 'stream' 'host' => 'localhost', 'port' => 7474, //'username' => null, //'password' => null, ), ), ), ), );
Service Locator
To access the entity manager, use the main service locator:
$em = $this->getServiceLocator()->get('neo4j.entitymanager.ogm_default'); $em = $this->getServiceLocator()->get('Neo4j\OGM\EntityManager');