Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Stdlib / SplQueue.php
blobe18ebc682184341198768a36f2f4aa40d6155aaf
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Stdlib;
12 use Serializable;
14 /**
15 * Serializable version of SplQueue
17 class SplQueue extends \SplQueue implements Serializable
19 /**
20 * Return an array representing the queue
22 * @return array
24 public function toArray()
26 $array = array();
27 foreach ($this as $item) {
28 $array[] = $item;
30 return $array;
33 /**
34 * Serialize
36 * @return string
38 public function serialize()
40 return serialize($this->toArray());
43 /**
44 * Unserialize
46 * @param string $data
47 * @return void
49 public function unserialize($data)
51 foreach (unserialize($data) as $item) {
52 $this->push($item);