Skip to content

Instantly share code, notes, and snippets.

@veewee
Created March 28, 2014 12:37
Show Gist options
  • Save veewee/9831772 to your computer and use it in GitHub Desktop.
Save veewee/9831772 to your computer and use it in GitHub Desktop.
Sample custom doctrine hydrator
<?php
return array(
'doctrine-hydrator' => array(
'MyApi\\V1\\Rest\\Assets\\AssetsHydrator' => array(
'entity_class' => 'Application\\Entity\\Asset',
'object_manager' => 'doctrine.documentmanager.odm_default',
'by_value' => true,
'strategies' => [
'categories' => 'DoctrineHydrationModule\Strategy\ODM\MongoDB\EmbeddedReferenceCollection',
'userGroups' => 'DoctrineHydrationModule\Strategy\ODM\MongoDB\EmbeddedReferenceCollection',
]
),
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment