Created
May 23, 2013 13:16
-
-
Save bakura10/5635994 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @license MIT | |
* @author Michaël Gallego <mic.gallego@gmail.com> | |
*/ | |
class RestAggregateHydrator extends AggregateHydrator | |
{ | |
/** | |
* Hydrators are runned in a specific order to allow pre-process at each step | |
*/ | |
const PAGINATOR_PRIORITY = 500; | |
/** | |
* @var HydratorPluginManager | |
*/ | |
protected $hydratorManager; | |
/** | |
* @param HydratorPluginManager $hydratorManager | |
*/ | |
public function __construct(HydratorPluginManager $hydratorManager) | |
{ | |
$this->hydratorManager = $hydratorManager; | |
$this->add($hydratorManager->get('ZfrRest\Stdlib\Hydrator\PaginatorHydrator'), self::PAGINATOR_PRIORITY); | |
//$this->add($hydratorManager->get('ZfrRest\Stdlib\Hydrator\ResourceHydrator', 80)); | |
//$this->add($hydratorManager->get('ZfrRest\Stdlib\Hydrator\CollectionResourceHydrator', 80)); | |
$this->getEventManager()->attach(ExtractEvent::EVENT_EXTRACT, function(ExtractEvent $e) { | |
var_dump($e->getExtractedData()); | |
}, 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment