You are here

public function PriorityList::toArray in Zircon Profile 8

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

Return list as array

Parameters

int $flag:

Return value

array

File

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

Class

PriorityList

Namespace

Zend\Stdlib

Code

public function toArray($flag = self::EXTR_DATA) {
  $this
    ->sort();
  if ($flag == self::EXTR_BOTH) {
    return $this->items;
  }
  return array_map(function ($item) use ($flag) {
    return $flag == PriorityList::EXTR_PRIORITY ? $item['priority'] : $item['data'];
  }, $this->items);
}