You are here

public function AcquiaPurgeQueueItem::__set in Acquia Purge 7

Set a writable property.

Parameters

string $name: The name of the property, can be 'item_id' or 'created'.

mixed $value: The value of the property you want to set.

Throws

\RuntimeException Thrown when the requested property isn't 'item_id' or 'created'.

Overrides AcquiaPurgeQueueItemInterface::__set

See also

http://php.net/manual/en/language.oop5.overloading.php#object.set

File

lib/queue/AcquiaPurgeQueueItem.php, line 101

Class

AcquiaPurgeQueueItem
Provides a queue item object.

Code

public function __set($name, $value) {
  if (!isset($this->properties[$name])) {
    throw new RuntimeException("The property '{$name}' does not exist.");
  }
  if (!$this->properties[$name]) {
    throw new RuntimeException("The property '{$name}' is read-only.");
  }
  $this->{$name} = $value;
}