Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. QueueInterface.php

function QueueInterface::offer

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.

When using a capacity-restricted queue, this method is generally preferable to `add()`, which can fail to insert an element only by throwing an exception.

Parameters

T $element The element to add to this queue.:

Return value

bool `true` if the element was added to this queue, else `false`.

See also

self::add()

1 method overrides QueueInterface::offer()
Queue::offer in vendor/ramsey/collection/src/Queue.php
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.

File

vendor/ramsey/collection/src/QueueInterface.php, line 162

Class

QueueInterface
A queue is a collection in which the entities in the collection are kept in order.

Namespace

Ramsey\Collection

Code

public function offer(mixed $element) : bool;
RSS feed
Powered by Drupal