Merged in release/3.2.2 (pull request #6146)

release/3.2.2

Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
Paula Quispe
2017-10-26 12:07:07 +00:00
2 changed files with 96 additions and 96 deletions

View File

@@ -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;