mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 02:34:03 +00:00
Delete unused method
This commit is contained in:
parent
97f227a037
commit
7d77c171d5
1 changed files with 0 additions and 15 deletions
|
|
@ -48,21 +48,6 @@ trait DealsWithModels
|
||||||
return static::getModels()->filter(fn (Model $model) => tenancy()->modelBelongsToTenant($model) || tenancy()->modelBelongsToTenantIndirectly($model));
|
return static::getModels()->filter(fn (Model $model) => tenancy()->modelBelongsToTenant($model) || tenancy()->modelBelongsToTenantIndirectly($model));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getModelFromTable(string $table): Model|null
|
|
||||||
{
|
|
||||||
foreach (get_declared_classes() as $class) {
|
|
||||||
if (is_subclass_of($class, Model::class)) {
|
|
||||||
$model = new $class;
|
|
||||||
|
|
||||||
if ($model->getTable() === $table) {
|
|
||||||
return $model;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function modelBelongsToTenant(Model $model): bool
|
public static function modelBelongsToTenant(Model $model): bool
|
||||||
{
|
{
|
||||||
return in_array(BelongsToTenant::class, class_uses_recursive($model::class));
|
return in_array(BelongsToTenant::class, class_uses_recursive($model::class));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue