You are here

public function PriorityList::insert in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-stdlib/src/PriorityList.php \Zend\Stdlib\PriorityList::insert()

Insert a new item.

Parameters

string $name:

mixed $value:

int $priority:

Return value

void

File

vendor/zendframework/zend-stdlib/src/PriorityList.php, line 63

Class

PriorityList

Namespace

Zend\Stdlib

Code

public function insert($name, $value, $priority = 0) {
  if (!isset($this->items[$name])) {
    $this->count++;
  }
  $this->sorted = false;
  $this->items[$name] = [
    'data' => $value,
    'priority' => (int) $priority,
    'serial' => $this->serial++,
  ];
}