2017 © Pedro Peláez
 

library doctrinebridgebundle

image

netvlies/doctrinebridgebundle

  • Friday, July 19, 2013
  • by mdekrijger
  • Repository
  • 12 Watchers
  • 24 Stars
  • 238 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Netvlies DoctrineBridge

This bundle provides a bridge functionality between different doctrine managers. The bridge functionality makes it possible to make interlinked relations between an entity and a document (and vice versa) using annotations. An example for a document:, (*1)

use Netvlies\Bundle\DoctrineBridgeBundle\Mapping\Annotations as BRIDGE;

/**
 *
 * @PHPCRODM\Document(referenceable=true)
 */
class MyPage
{
     * @PHPCRODM\String
     * @BRIDGE\Entity(targetEntity="MyBundle:Media", entityManager="default")
     */
    protected $media;

And vice versa, (*2)

use Netvlies\Bundle\DoctrineBridgeBundle\Mapping\Annotations as BRIDGE;

/**
 * @ORM\Table()
 * @ORM\Entity
 */
class OrderLine
{
     * @ORM\Column(name="product", type="string", length=255)
     * @BRIDGE\Document(targetDocument="MyBundle:Product", documentManager="default")
     */
    private $product;

Using this annotation, it will load a reference object when retrieved, and will be resolved from storage engine when asked for. Also when assigned and saved it will store the UID from the other side, so it can be resolved when retrieved again., (*3)

TODO

  • There are no tests yet. The bundle is quite simple now, but with further development tests should be added and checked in Travis
  • Currently it only supports x-to-one relations. So this is must be added later on to have at least support for one-to-many relations.
  • Currently it has only support ORM and PHPCR. So support for mongoDB and/or other storage engines might be added in the future.

Installation

You can either use composer or include it into your deps file. For composer:, (*4)

"netvlies/doctrinebridgebundle": "dev-master",

Deps file, (*5)

[doctrineBridgeBundle]
git=http://github.com/netvlies/DoctrineBridgeBundle.git

After that you need to add following line to your autoload.php and change the path accordingly (if needed), (*6)

AnnotationRegistry::registerFile(__DIR__.'/../vendor/netvlies/doctrinebridge/Netvlies/Bundle/DoctrineBridgeBundle/Mapping/Annotations/DoctrineAnnotations.php');

And dont't forget it to include into your AppKernel.php, (*7)

new Netvlies\Bundle\DoctrineBridgeBundle\NetvliesDoctrineBridgeBundle(),

The Versions

19/07 2013

dev-master

9999999-dev

  Sources   Download

26/07 2012

dev-phpunit

dev-phpunit

This bundle provides a bridge functionality between different doctrine managers. The bridge functionality makes it possible to make interlinked relations between an entity and a document (and vice versa) using annotations.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires