From 50212e95676e223ccf22825cd2b6f714c04bdf3f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 3 May 2018 21:46:34 +0300 Subject: [PATCH] Fix for tests --- app/Models/EntityModel.php | 17 +++++++++++------ bootstrap/autoload.php | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index d4df431d07d8..96bf7c57ad70 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -449,20 +449,25 @@ class EntityModel extends Eloquent return $this->id == $obj->id && $this->getEntityType() == $obj->entityType; } + /** * @param $method * @param $params */ public function __call($method, $params) { - $entityType = $this->getEntityType(); - if ($entityType) { - $config = implode('.', ['modules.relations.' . $entityType, $method]); - if (config()->has($config)) { - $function = config()->get($config); - return $function($this); + if (count(config('modules.relations'))) { + $entityType = $this->getEntityType(); + + if ($entityType) { + $config = implode('.', ['modules.relations.' . $entityType, $method]); + if (config()->has($config)) { + $function = config()->get($config); + return $function($this); + } } } + return parent::__call($method, $params); } } diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index 6c8aaf6c3640..d1a406d25936 100755 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -1,7 +1,7 @@