You are here

class SplQueue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-stdlib/src/SplQueue.php \Zend\Stdlib\SplQueue

Serializable version of SplQueue

Hierarchy

  • class \Zend\Stdlib\SplQueue implements \Serializable
    • class \Zend\Stdlib\SplQueue implements \Serializable

Expanded class hierarchy of SplQueue

File

vendor/zendframework/zend-stdlib/src/SplQueue.php, line 17

Namespace

Zend\Stdlib
View source
class SplQueue extends \SplQueue implements Serializable {

  /**
   * Return an array representing the queue
   *
   * @return array
   */
  public function toArray() {
    $array = [];
    foreach ($this as $item) {
      $array[] = $item;
    }
    return $array;
  }

  /**
   * Serialize
   *
   * @return string
   */
  public function serialize() {
    return serialize($this
      ->toArray());
  }

  /**
   * Unserialize
   *
   * @param  string $data
   * @return void
   */
  public function unserialize($data) {
    foreach (unserialize($data) as $item) {
      $this
        ->push($item);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SplQueue::serialize public function Serialize Overrides SplQueue::serialize 1
SplQueue::toArray public function Return an array representing the queue Overrides SplQueue::toArray 1
SplQueue::unserialize public function Unserialize Overrides SplQueue::unserialize 1