2017 © Pedro Peláez
 

library serializer-doctrine-proxies

Provides Doctrine proxies handler for JMS Serializer to disable lazy-loading and recursion during serialization.

image

alcalyn/serializer-doctrine-proxies

Provides Doctrine proxies handler for JMS Serializer to disable lazy-loading and recursion during serialization.

  • Wednesday, June 1, 2016
  • by alcalyn
  • Repository
  • 0 Watchers
  • 6 Stars
  • 1,457 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 12 % Grown

The README.md

Serialize Doctrine Proxies

Latest Stable Version Total Downloads License, (*1)

Provides Doctrine proxies handler for JMS Serializer to disable lazy-loading and recursion during serialization., (*2)

This library solves problems discussed on Stack Overflow, in this thread, or this one, and is inspired by this gist., (*3)

Installation

Using Composer:, (*4)

``` js { "require": { "alcalyn/serializer-doctrine-proxies": "1.x" } }, (*5)



## Usage You have to add a handler and a listener to your Serializer instance. Here using SerializerBuilder: ``` php use Alcalyn\SerializerDoctrineProxies\DoctrineProxyHandler; use Alcalyn\SerializerDoctrineProxies\DoctrineProxySubscriber; use JMS\Serializer\EventDispatcher\EventDispatcher; use JMS\Serializer\Handler\HandlerRegistryInterface; use JMS\Serializer\SerializerBuilder; $serializer = SerializerBuilder::create() ->addDefaultHandlers() // This line to avoid to default handlers to be overrided by the new one. ->configureHandlers(function (HandlerRegistryInterface $handlerRegistry) { $handlerRegistry->registerSubscribingHandler(new DoctrineProxyHandler()); }) ->configureListeners(function (EventDispatcher $dispatcher) { $dispatcher->addSubscriber(new DoctrineProxySubscriber(false)); // false to disable lazy loading. }) ->build() ; $serializer->serialize($myEntityWithABunchOfRelationsIDontWantToLazyLoadDuringSerialization);

License

This project is under MIT., (*6)

The Versions

01/06 2016

dev-master

9999999-dev https://github.com/alcalyn/serializer-doctrine-proxies

Provides Doctrine proxies handler for JMS Serializer to disable lazy-loading and recursion during serialization.

  Sources   Download

MIT

The Requires

 

serializer doctrine

01/06 2016

1.1.2

1.1.2.0 https://github.com/alcalyn/serializer-doctrine-proxies

Provides Doctrine proxies handler for JMS Serializer to disable lazy-loading and recursion during serialization.

  Sources   Download

MIT

The Requires

 

serializer doctrine

01/06 2016

1.1.1

1.1.1.0 https://github.com/alcalyn/serializer-doctrine-proxies

Provides Doctrine proxies handler for JMS Serializer to disable lazy-loading and recursion during serialization.

  Sources   Download

MIT

The Requires

 

serializer doctrine

24/05 2016

1.1.0

1.1.0.0 https://github.com/alcalyn/serializer-doctrine-proxies

Provides Doctrine proxies handler for JMS Serializer to disable lazy-loading and recursion during serialization.

  Sources   Download

MIT

The Requires

 

serializer doctrine

06/05 2016

1.0.0

1.0.0.0 https://github.com/alcalyn/serializer-doctrine-proxies

Provides Doctrine proxies handler for JMS Serializer to disable lazy-loading and recursion during serialization.

  Sources   Download

MIT

The Requires

 

serializer doctrine