public function TxBuffer::getFiltered in Purge 8.3
Only retrieve items from the buffer in a particular given state(s).
Parameters
int|array $states: Individual state or array with one of the following states:
- \Drupal\purge\Plugin\Purge\Queue\TxBufferInterface::CLAIMED
- \Drupal\purge\Plugin\Purge\Queue\TxBufferInterface::ADDING
- \Drupal\purge\Plugin\Purge\Queue\TxBufferInterface::ADDED
- \Drupal\purge\Plugin\Purge\Queue\TxBufferInterface::RELEASING
- \Drupal\purge\Plugin\Purge\Queue\TxBufferInterface::RELEASED
- \Drupal\purge\Plugin\Purge\Queue\TxBufferInterface::DELETING.
Return value
\Drupal\purge\Plugin\Purge\Invalidation\InvalidationInterface[] List of invalidation objects.
Overrides TxBufferInterface::getFiltered
File
- src/
Plugin/ Purge/ Queue/ TxBuffer.php, line 92
Class
- TxBuffer
- Provides the transaction buffer.
Namespace
Drupal\purge\Plugin\Purge\QueueCode
public function getFiltered($states) {
if (!is_array($states)) {
$states = [
$states,
];
}
$results = [];
foreach ($this->states as $id => $state) {
if (in_array($state, $states)) {
$results[] = $this->instances[$id];
}
}
return $results;
}