class GenerateGoogleSitemapJob extends AbstractQueuedJob (View source)

A job for generating a site's google sitemap

If the sitemap module is installed, uses information from that to populate things

Properties

protected stdClass $jobData from  AbstractQueuedJob
protected array $messages from  AbstractQueuedJob
protected int $totalSteps from  AbstractQueuedJob
protected int $currentStep from  AbstractQueuedJob
protected bool $isComplete from  AbstractQueuedJob

Methods

public
__construct()

Extensions can have a construct but don't have too.

public
string
getTitle()

No description

protected
setObject(DataObject $object, string $name = 'Object')

Sets a data object for persisting by adding its id and type to the serialised vars

protected
DataObject|void
getObject(string $name = 'Object')

No description

public
string
getSignature()

Return a signature for this queued job

protected
string
randomSignature()

Generate a somewhat random signature

public
getJobType()

Sitemap job is going to run for a while.

public
setup()

Note that this is duplicated for backwards compatibility purposes.

public
prepareForRestart()

On any restart, make sure to check that our temporary file is being created still.

public
process()

Do some processing yourself!

public
jobFinished()

Method for determining whether the job is finished - you may override it if there's more to it than just this

public
afterComplete()

Called when the job is determined to be 'complete'

public
getJobData()

No description

public
setJobData(int $totalSteps, int $currentStep, bool $isComplete, stdClass $jobData, array $messages)

No description

public
array|null
getCustomConfig()

Gets custom config settings to use when running the job.

public
setCustomConfig(array $config)

Sets custom config settings to use when the job is run.

public
addMessage(string $message, string $severity = 'INFO')

No description

public
__set(mixed $name, mixed $value)

Convenience methods for setting and getting job data

public
mixed
__get(mixed $name)

Retrieve some job data

protected
completeJob()

Outputs the completed file to the site's webroot

Details

__construct()

Extensions can have a construct but don't have too.

Without a construct, it's impossible to create a job in the CMS

string getTitle()

No description

Return Value

string

protected setObject(DataObject $object, string $name = 'Object')

Sets a data object for persisting by adding its id and type to the serialised vars

Parameters

DataObject $object
string $name

A name to give it, if you want to store more than one

protected DataObject|void getObject(string $name = 'Object')

No description

Parameters

string $name

Return Value

DataObject|void

string getSignature()

Return a signature for this queued job

For the generate sitemap job, we only ever want one instance running, so just use the class name

Return Value

string

protected string randomSignature()

Generate a somewhat random signature

useful if you're want to make sure something is always added

Return Value

string

getJobType()

Sitemap job is going to run for a while.

..

setup()

Note that this is duplicated for backwards compatibility purposes.

..

prepareForRestart()

On any restart, make sure to check that our temporary file is being created still.

process()

Do some processing yourself!

jobFinished()

Method for determining whether the job is finished - you may override it if there's more to it than just this

afterComplete()

Called when the job is determined to be 'complete'

getJobData()

No description

setJobData(int $totalSteps, int $currentStep, bool $isComplete, stdClass $jobData, array $messages)

No description

Parameters

int $totalSteps
int $currentStep
bool $isComplete
stdClass $jobData
array $messages

array|null getCustomConfig()

Gets custom config settings to use when running the job.

Return Value

array|null

setCustomConfig(array $config)

Sets custom config settings to use when the job is run.

Parameters

array $config

addMessage(string $message, string $severity = 'INFO')

No description

Parameters

string $message
string $severity

__set(mixed $name, mixed $value)

Convenience methods for setting and getting job data

Parameters

mixed $name
mixed $value

mixed __get(mixed $name)

Retrieve some job data

Parameters

mixed $name

Return Value

mixed

protected completeJob()

Outputs the completed file to the site's webroot