interface AcquiaPurgeQueueItemInterface in Acquia Purge 7
Describes a queue item object.
On the outside, these queue objects are identical in behavior to Drupal's standard DrupalReliableQueueInterface::claimItem() objects and allow read access to its 'item_id', 'created' and 'data' properties.
On top of that however, these objects are capable of letting executor plugins set statuses on them through the ::setStatus() method on the invalidation objects created by ::getInvalidation(). With this, we can easily evaluate the overall outcome at the end and claim or delete it from the queue.
Hierarchy
- interface \AcquiaPurgeQueueStatusInterface
- interface \AcquiaPurgeQueueItemInterface
Expanded class hierarchy of AcquiaPurgeQueueItemInterface
All classes that implement AcquiaPurgeQueueItemInterface
File
- lib/
queue/ AcquiaPurgeQueueItemInterface.php, line 15
View source
interface AcquiaPurgeQueueItemInterface extends AcquiaPurgeQueueStatusInterface {
/**
* Constructs an queue item object.
*
* @param int $created
* Timestamp when the item was put into the queue.
* @param mixed $data
* Purge specific data to be associated with the new task in the queue.
* @param int $expire
* Timestamp when the item expires from the queue.
* @param string|int $item_id
* The unique ID from AcquiaPurgeQueueInterface::createItem()
*/
public function __construct($created, $data, $expire, $item_id);
/**
* Retrieve a property.
*
* @param string $name
* The name of the property, can be 'item_id', 'created' or 'data'.
*
* @throws \RuntimeException
* Thrown when the requested property isn't 'item_id', 'created' or 'data'.
*
* @see http://php.net/manual/en/language.oop5.overloading.php#object.get
*
* @return mixed
*/
public function __get($name);
/**
* Set a writable property.
*
* @param string $name
* The name of the property, can be 'item_id' or 'created'.
* @param mixed $value
* The value of the property you want to set.
*
* @throws \RuntimeException
* Thrown when the requested property isn't 'item_id' or 'created'.
*
* @see http://php.net/manual/en/language.oop5.overloading.php#object.set
*/
public function __set($name, $value);
/**
* Create a invalidation object for the given scheme, domain and base path.
*
* @param string $scheme
* The requested scheme to be invalidated: 'http' or 'https'.
* @param string $domain
* The domain name to clear the path on, e.g. "foo.com" or "bar.baz".
* @param string $base_path
* Drupal's base path (or the one Acquia Purge is told to clear).
*
* @return AcquiaPurgeInvalidationInterface
*/
public function getInvalidation($scheme, $domain, $base_path);
/**
* Get the HTTP path.
*
* @return string
* The path to wipe, e.g. 'user/1?d=foo' or 'news/*'.
*/
public function getPath();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AcquiaPurgeQueueItemInterface:: |
public | function | Create a invalidation object for the given scheme, domain and base path. | 1 |
AcquiaPurgeQueueItemInterface:: |
public | function | Get the HTTP path. | 1 |
AcquiaPurgeQueueItemInterface:: |
public | function | Constructs an queue item object. | 1 |
AcquiaPurgeQueueItemInterface:: |
public | function | Retrieve a property. | 1 |
AcquiaPurgeQueueItemInterface:: |
public | function | Set a writable property. | 1 |
AcquiaPurgeQueueStatusInterface:: |
constant | The actor failed processing the item. | ||
AcquiaPurgeQueueStatusInterface:: |
constant | Item is new and no processing has been attempted on it yet. | ||
AcquiaPurgeQueueStatusInterface:: |
public | function | Get the current or general status of this object. | |
AcquiaPurgeQueueStatusInterface:: |
public | function | Get a boolean representation of the general status of this object. | |
AcquiaPurgeQueueStatusInterface:: |
public | function | Get the current status as string. | |
AcquiaPurgeQueueStatusInterface:: |
public | function | Set the status of the object. | |
AcquiaPurgeQueueStatusInterface:: |
public | function | Set (or reset) status context to the executor instance next in line. | 1 |
AcquiaPurgeQueueStatusInterface:: |
public | function | Set the status to AcquiaPurgeQueueStatusInterface::FAILED. | |
AcquiaPurgeQueueStatusInterface:: |
public | function | Set the status to AcquiaPurgeQueueStatusInterface::SUCCEEDED. | |
AcquiaPurgeQueueStatusInterface:: |
constant | The actor succeeded processing the item. |