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

Traits

Provides extensions to this object to integrate it with standard config API methods.

Properties

static private int $regenerate_time

Methods

__construct()

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

string
getTitle()

No description

string
getSignature()

Return a signature for this queued job

getJobType()

Sitemap job is going to run for a while.

int|null
getRunAsMemberID()

Specifies what user ID should be when running the job valid values: null - (default) - run the job as current user 0 - run the job without a user greater than zero - run the job as a specific user

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

array|null
getCustomConfig()

Gets custom config settings to use when running the job.

setCustomConfig(array $config)

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

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

No description

__set(mixed $name, mixed $value)

Convenience methods for setting and getting job data

mixed
__get(mixed $name)

Retrieve some job data

static Config_ForClass
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

mixed
stat(string $name) deprecated

Get inherited config value

mixed
uninherited(string $name)

Gets the uninherited value for the given config option

$this
set_stat(string $name, mixed $value) deprecated

Update the config value for a given property

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()

Return Value

string

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

getJobType()

Sitemap job is going to run for a while.

..

int|null getRunAsMemberID()

Specifies what user ID should be when running the job valid values: null - (default) - run the job as current user 0 - run the job without a user greater than zero - run the job as a specific user

This is useful in situations like:

  • a job needs to always run without a user (like a static cache job)
  • a job needs to run as a specific user (for example data migration job)

Note that this value can be overridden in the see QueuedJobService::queueJob()

Return Value

int|null

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'

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

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')

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

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed stat(string $name) deprecated

deprecated 5.0 Use ->config()->get() instead

Get inherited config value

Parameters

string $name

Return Value

mixed

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

$this set_stat(string $name, mixed $value) deprecated

deprecated 5.0 Use ->config()->set() instead

Update the config value for a given property

Parameters

string $name
mixed $value

Return Value

$this