ocramius / zf-phpcr-odm
Zend Framework 2 Module that provides Doctrine PHPCR ODM functionality
Requires
- php: >=5.3.3
- doctrine/doctrine-module: ~0.7
- doctrine/phpcr-odm: dev-master
- jackalope/jackalope-doctrine-dbal: dev-master
- jackalope/jackalope-jackrabbit: dev-master
Suggests
- midgard/phpcr: Midgard2 adapter for PHPCR if you want to use midgard instead of dbal or jackrabbit
- ocramius/ocra-di-compiler: Since the module uses Zend\Di extensively, consider compiling it with OcraDiCompiler
Replaces
- ocramius/zfphpcrodm: dev-master
This package is auto-updated.
Last update: 2019-02-20 19:28:00 UTC
README
Overview
This Module provides functionality to connect Zend Framework 2 and Doctrine PHPCR-ODM. It provides configuration and dependencies for both Jackrabbit and DBAL JCR backends, and allows usage with Midgard2 too.
Requirements
The module runs on any typical Zend Framework 2 Skeleton application setup.
Setup
Following steps are necessary to get this project working (considering a zf2-skeleton or very similar application)
- add
"ocramius/zf-phpcr-odm": "dev-master"
to yourcomposer.json
("minimum-stability": "dev"
is also required) - Add
DoctrineModule
andZfPhpcrOdm
to the enabled modules list - create directory
my/project/directory/data/ZfPhpcrOdm/Proxy
and make sure your application has write access to it. This directory can be changed using the module options.
Usage
This module allows you to simply ask the default application's ServiceLocator
for an instance of Doctrine\ODM\PHPCR\DocumentManager
:
<?php $documentManager = $serviceLocator->get('Doctrine\ODM\PHPCR\DocumentManager');
Examples
Please refer to https://github.com/Ocramius/ZfPhpcrOdmSample to see a working example of this module being used.