You are here

public function ArrayObject::unserialize in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-stdlib/src/ArrayObject.php \Zend\Stdlib\ArrayObject::unserialize()

Unserialize an ArrayObject

Parameters

string $data:

Return value

void

File

vendor/zendframework/zend-stdlib/src/ArrayObject.php, line 405

Class

ArrayObject
Custom framework ArrayObject implementation

Namespace

Zend\Stdlib

Code

public function unserialize($data) {
  $ar = unserialize($data);
  $this->protectedProperties = array_keys(get_object_vars($this));
  $this
    ->setFlags($ar['flag']);
  $this
    ->exchangeArray($ar['storage']);
  $this
    ->setIteratorClass($ar['iteratorClass']);
  foreach ($ar as $k => $v) {
    switch ($k) {
      case 'flag':
        $this
          ->setFlags($v);
        break;
      case 'storage':
        $this
          ->exchangeArray($v);
        break;
      case 'iteratorClass':
        $this
          ->setIteratorClass($v);
        break;
      case 'protectedProperties':
        continue;
      default:
        $this
          ->__set($k, $v);
    }
  }
}