Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme: How to register type if I use Doctrine directly #2

Closed
dimabory opened this issue Jan 25, 2019 · 1 comment
Closed

Update readme: How to register type if I use Doctrine directly #2

dimabory opened this issue Jan 25, 2019 · 1 comment

Comments

@dimabory
Copy link

Adopting this code:

require_once __DIR__.'/../vendor/autoload.php';

use Goodwix\DoctrineJsonOdm\Type\ODMType;
use Symfony\Component\Serializer\SerializerInterface;

class Document { }

ODMType::registerODMType(
    Document::class,
    new class implements SerializerInterface
    {
        public function serialize($data, $format, array $context = [])  { /* Implement serialize() method. */ }
        public function deserialize($data, $type, $format, array $context = [])  { /* Implement deserialize() method. */ }
    }
);
@dimabory dimabory changed the title Update readme: How to register type if I use Doctrine directle Update readme: How to register type if I use Doctrine directly Mar 1, 2019
@strider2038
Copy link
Contributor

@dimabory thanks, we added a description to readme https://github.com/goodwix/doctrine-json-odm#manual-usage-with-doctrine-and-symfony-serializer-component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants