Created
April 22, 2014 18:53
-
-
Save EclipseGc/11190303 to your computer and use it in GitHub Desktop.
RestResourceDerivativeDecorator
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
<?php | |
class RestResourceDerivativeDecorator extends DerivativeDiscoveryDecorator { | |
public function __construct(DiscoveryInterface $decorated, RouteCollection $collection) { | |
parent::__construct($decorated); | |
$this->collection = $collection; | |
} | |
protected function getDerivativeFetcher($base_plugin_id, $base_definition) { | |
if (!isset($this->derivativeFetchers[$base_plugin_id])) { | |
$this->derivativeFetchers[$base_plugin_id] = FALSE; | |
$class = $this->getDerivativeClass($base_definition); | |
if ($class) { | |
$this->derivativeFetchers[$base_plugin_id] = new $class($base_plugin_id, $this->collection); | |
} | |
} | |
return $this->derivativeFetchers[$base_plugin_id] ?: NULL; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment