mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
77969243fa
This reverts commit b635f3b32e
.
27 lines
576 B
PHP
27 lines
576 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Hashids\Hashids;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class BaseModel extends Model
|
|
{
|
|
public function __call($method, $params)
|
|
{
|
|
$entity = strtolower(class_basename($this));
|
|
|
|
if ($entity) {
|
|
$configPath = "modules.relations.$entity.$method";
|
|
|
|
if (config()->has($configPath)) {
|
|
$function = config()->get($configPath);
|
|
|
|
return call_user_func_array(array($this, $function[0]), $function[1]);
|
|
}
|
|
}
|
|
|
|
return parent::__call($method, $params);
|
|
}
|
|
}
|