Merged in bugfix/HOR-4000 (pull request #6137)
Bugfix/HOR-4000 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -171,6 +171,14 @@ class Restler extends \Luracast\Restler\Restler
|
||||
$this->responseData = $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Review the API extensions, if the extension exists a new instance is
|
||||
* returned.
|
||||
*
|
||||
* @param object $object
|
||||
* @param string $className
|
||||
* @return \Maveriks\Extension\classExtName
|
||||
*/
|
||||
public function reviewApiExtensions($object, $className)
|
||||
{
|
||||
$classReflection = new \ReflectionClass($object);
|
||||
@@ -178,10 +186,10 @@ class Restler extends \Luracast\Restler\Restler
|
||||
$registry = PluginRegistry::loadSingleton();
|
||||
$pluginsApiExtend = $registry->getExtendsRestService($classShortName);
|
||||
if ($pluginsApiExtend) {
|
||||
$classFilePath = $pluginsApiExtend['filePath'];
|
||||
$classFilePath = $pluginsApiExtend->filePath;
|
||||
if (file_exists($classFilePath)) {
|
||||
require_once($classFilePath);
|
||||
$classExtName = $pluginsApiExtend['classExtend'];
|
||||
$classExtName = $pluginsApiExtend->classExtend;
|
||||
$newObjectExt = new $classExtName();
|
||||
if (is_subclass_of($newObjectExt, $className)) {
|
||||
$object = $newObjectExt;
|
||||
|
||||
Reference in New Issue
Block a user