Fix for tests

This commit is contained in:
Hillel Coren 2018-05-03 21:46:34 +03:00
parent 9e81237269
commit 50212e9567
2 changed files with 12 additions and 7 deletions

View File

@ -449,20 +449,25 @@ class EntityModel extends Eloquent
return $this->id == $obj->id && $this->getEntityType() == $obj->entityType; return $this->id == $obj->id && $this->getEntityType() == $obj->entityType;
} }
/** /**
* @param $method * @param $method
* @param $params * @param $params
*/ */
public function __call($method, $params) public function __call($method, $params)
{ {
$entityType = $this->getEntityType(); if (count(config('modules.relations'))) {
if ($entityType) { $entityType = $this->getEntityType();
$config = implode('.', ['modules.relations.' . $entityType, $method]);
if (config()->has($config)) { if ($entityType) {
$function = config()->get($config); $config = implode('.', ['modules.relations.' . $entityType, $method]);
return $function($this); if (config()->has($config)) {
$function = config()->get($config);
return $function($this);
}
} }
} }
return parent::__call($method, $params); return parent::__call($method, $params);
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
// https://laracasts.com/discuss/channels/general-discussion/l5-maximum-function-nesting-level-of-100-reached-aborting/ // https://laracasts.com/discuss/channels/general-discussion/l5-maximum-function-nesting-level-of-100-reached-aborting/
ini_set('xdebug.max_nesting_level', 512); ini_set('xdebug.max_nesting_level', 256);
define('LARAVEL_START', microtime(true)); define('LARAVEL_START', microtime(true));