Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117747100
DomainJob.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
DomainJob.php
View Options
<?php
namespace
App\Jobs
;
/**
* The abstract \App\Jobs\DomainJob implements the logic needed for all dispatchable Jobs related to
* \App\Domain objects.
*
* ```php
* $job = new \App\Jobs\Domain\CreateJob($domainId);
* $job->handle();
* ```
*/
abstract
class
DomainJob
extends
CommonJob
{
/**
* The ID for the \App\Domain. This is the shortest globally unique identifier and saves Redis space
* compared to a serialized version of the complete \App\Domain object.
*
* @var int
*/
protected
$domainId
;
/**
* The \App\Domain namespace property, for legibility in the queue management.
*
* @var string
*/
protected
$domainNamespace
;
/**
* Create a new job instance.
*
* @param int $domainId The ID for the domain to create.
*
* @return void
*/
public
function
__construct
(
int
$domainId
)
{
$this
->
domainId
=
$domainId
;
$domain
=
$this
->
getDomain
();
if
(
$domain
)
{
$this
->
domainNamespace
=
$domain
->
namespace
;
}
}
/**
* Get the \App\Domain entry associated with this job.
*
* @return \App\Domain|null
*
* @throws \Exception
*/
protected
function
getDomain
()
{
$domain
=
\App\Domain
::
withTrashed
()->
find
(
$this
->
domainId
);
if
(!
$domain
)
{
// The record might not exist yet in case of a db replication environment
// This will release the job and delay another attempt for 5 seconds
if
(
$this
instanceof
Domain\CreateJob
)
{
$this
->
release
(
5
);
return
null
;
}
$this
->
fail
(
new
\Exception
(
"Domain {$this->domainId} could not be found in the database."
));
}
return
$domain
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Apr 4 2026, 12:07 AM (4 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
93/d5/2355cb5f89bc6252c86df0577cce
Default Alt Text
DomainJob.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline