class URLArrayObject extends ArrayObject (View source)

This is an helper object to StaticPagesQueue to hold an array of urls with priorites to be recached.

If the StaticPagesQueue::is_realtime is false this class will call StaticPagesQueue::push_urls_to_db when in __destructs.

Methods

public
string
addObject($url, DataObject $dataObject)

Adds metadata into the URL.

public
array
addObjects($urls, DataObject $dataObject)

Adds metadata into all URLs in the array.

public
getObject($url)

Extracts the metadata from the queued structure.

public
addUrlsOnBehalf(array $urls, DataObject $dataObject)

Adds urls to the queue after injecting the objects' metadata.

public
addUrls(array $urls)

The format of the urls should be array( 'URLSegment' => '50')

protected
excludeFromCache($url)

No description

public
destructMethod()

When this class is getting garbage collected, trigger the insert of all urls into the database

public
type
insertIntoDB()

This method will insert all URLs that exists in this object into the database by calling the StaticPagesQueue

protected
int
sortOnPriority(array $a, array $b)

Sorts the array on priority, from highest to lowest

public static 
sanitize_url($url)

No description

Details

string addObject($url, DataObject $dataObject)

Adds metadata into the URL.

Parameters

$url string
DataObject $dataObject

Return Value

string

transformed URL.

array addObjects($urls, DataObject $dataObject)

Adds metadata into all URLs in the array.

Parameters

$urls

array of url => priority

DataObject $dataObject

Return Value

array

array of transformed URLs.

DataObject getObject($url)

Extracts the metadata from the queued structure.

Parameters

$url string

Return Value

DataObject

represented by the URL.

addUrlsOnBehalf(array $urls, DataObject $dataObject)

Adds urls to the queue after injecting the objects' metadata.

Parameters

array $urls

array associative array of url => priority

DataObject $dataObject

DataObject object to associate the urls with

addUrls(array $urls)

The format of the urls should be array( 'URLSegment' => '50')

Parameters

array $urls

protected excludeFromCache($url)

No description

Parameters

$url

destructMethod()

When this class is getting garbage collected, trigger the insert of all urls into the database

type insertIntoDB()

This method will insert all URLs that exists in this object into the database by calling the StaticPagesQueue

Return Value

type

protected int sortOnPriority(array $a, array $b)

Sorts the array on priority, from highest to lowest

Parameters

array $a
array $b

Return Value

int
  • signed

static sanitize_url($url)

No description

Parameters

$url