Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Command.php
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | protected function getObjectModel($objectClass, $withDeleted = false) | ||||
} | } | ||||
$modelsWithTenant = [ | $modelsWithTenant = [ | ||||
\App\Discount::class, | \App\Discount::class, | ||||
\App\Domain::class, | \App\Domain::class, | ||||
\App\Group::class, | \App\Group::class, | ||||
\App\Package::class, | \App\Package::class, | ||||
\App\Plan::class, | \App\Plan::class, | ||||
\App\Resource::class, | |||||
\App\Sku::class, | \App\Sku::class, | ||||
\App\User::class, | \App\User::class, | ||||
]; | ]; | ||||
$modelsWithOwner = [ | $modelsWithOwner = [ | ||||
\App\Wallet::class, | \App\Wallet::class, | ||||
]; | ]; | ||||
Show All 10 Lines | protected function getObjectModel($objectClass, $withDeleted = false) | ||||
->whereRaw('users.tenant_id ' . ($tenantId ? "= $tenantId" : 'is null')); | ->whereRaw('users.tenant_id ' . ($tenantId ? "= $tenantId" : 'is null')); | ||||
}); | }); | ||||
} | } | ||||
return $model; | return $model; | ||||
} | } | ||||
/** | /** | ||||
* Find a resource. | |||||
* | |||||
* @param string $resource Resource ID or email | |||||
* @param bool $withDeleted Include deleted | |||||
* | |||||
* @return \App\Resource|null | |||||
*/ | |||||
public function getResource($resource, $withDeleted = false) | |||||
{ | |||||
return $this->getObject(\App\Resource::class, $resource, 'email', $withDeleted); | |||||
} | |||||
/** | |||||
* Find the user. | * Find the user. | ||||
* | * | ||||
* @param string $user User ID or email | * @param string $user User ID or email | ||||
* @param bool $withDeleted Include deleted | * @param bool $withDeleted Include deleted | ||||
* | * | ||||
* @return \App\User|null | * @return \App\User|null | ||||
*/ | */ | ||||
public function getUser($user, $withDeleted = false) | public function getUser($user, $withDeleted = false) | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |