diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index b86cc4c9de33..96ebdd2f527d 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -161,6 +161,11 @@ class EntityModel extends Eloquent $query->where($this->getTable() .'.account_id', '=', $accountId); + if (func_num_args() > 1 && ! $publicId) { + $query->where('id', '=', 0); + return $query; + } + if ($publicId) { if (is_array($publicId)) { $query->whereIn('public_id', $publicId);