Changeset View
Changeset View
Standalone View
Standalone View
src/app/Jobs/DomainDelete.php
Show All 21 Lines | class DomainDelete implements ShouldQueue | ||||
public $tries = 5; | public $tries = 5; | ||||
/** @var bool Delete the job if its models no longer exist. */ | /** @var bool Delete the job if its models no longer exist. */ | ||||
public $deleteWhenMissingModels = true; | public $deleteWhenMissingModels = true; | ||||
/** | /** | ||||
* Create a new job instance. | * Create a new job instance. | ||||
* | * | ||||
* @param Domain $domain The domain to delete. | * @param Domain $domain The domain to delete. | ||||
vanmeeuwen: `$domain` -> `$domain_id`. | |||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function __construct(Domain $domain) | public function __construct(Domain $domain) | ||||
{ | { | ||||
$this->domain = $domain; | $this->domain = $domain; | ||||
} | } | ||||
/** | /** | ||||
* Execute the job. | * Execute the job. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
if (!$this->domain->isDeleted()) { | |||||
LDAP::deleteDomain($this->domain); | LDAP::deleteDomain($this->domain); | ||||
$this->domain->status |= Domain::STATUS_DELETED; | |||||
$this->domain->save(); | |||||
} | |||||
} | } | ||||
} | } |
$domain -> $domain_id.