Invokes unserialization. Unserialization function is set by
globall config, model config or defaults to `unserialize`

@param string $alias Model using this behavior alias
@param mixed $data Data to serialize
@return mixed Unserialized data
175212
protected function _unserialize($alias, $data) {
		if (!is_string($data)) {
			return $data;
		}
		return call_user_func($this->config[$alias]['unserialize'], $data);
	}
927905
public function toSerialized($data = null)
	{
		if ($data === null)
		{
			$data = $this->data;
		}

		return serialize($data);
	}
874694
private function deserializeData($data)
    {
        $result = $this->get('jms_serializer')->deserialize(
            $data,
            $this->getTargetGroupRepository()->getClassName(),
            'json',
            DeserializationContext::create()
                ->setSerializeNull(true)
        );

        return $result;
    }
680979
private function serialize($data)
    {
        if ($this->type == 'db') {
            return $this->db->encode($data, $this->packed);
        }

        return $this->packed ? serialize($data) : $data;
    }
279531
public function unserialize($data)
    {
        $data = @unserialize($data);
        if (!is_array($data) ||
            !isset($data[0]) ||
            ($data[0] != self::VERSION)) {
            switch ($data[0]) {
            case 1:
                $convert = new Horde_Mime_Part_Upgrade_V1($data);
                $data = $convert->data;
                break;

            default:
                $data = null;
                break;
            }

            if (is_null($data)) {
                throw new Exception('Cache version change');
            }
        }

        $key = 0;
        $this->_bytes = $data[++$key];
        $this->_eol = $data[++$key];
        $this->_hdrCharset = $data[++$key];
        $this->_headers = $data[++$key];
        $this->_metadata = $data[++$key];
        $this->_mimeid = $data[++$key];
        $this->_parts = $data[++$key];
        $this->_status = $data[++$key];
        $this->_transferEncoding = $data[++$key];

        if (isset($data[++$key])) {
            $this->setContents($data[$key]);
        }
    }
272626
public static function unserialize(string $data) : self
    {
        $data = json_decode($data, true);

        /** @var Envelope $return */
        $return = new $data['class']();
        unset($data['class']);

        $return->jsonUnserialize($data);

        return $return;
    }
30489
public function unserialize($data)
    {
        foreach (unserialize($data) as $item) {
            $this->insert($item['data'], $item['priority']);
        }
    }
1060339
public function unserialize($data)
    {
        $this->wakeup();
        $this->init();

        $data = unserialize($data);

        // Ignore properties that shouldn't have been serialized. These
        // can be removed in the future.
        $ignored_properties = array(
            'internal_property_autosave',
            'internal_property_accessible',
            'internal_property_classes',
            'date_properties'
        );

        foreach ($data as $property => $value) {
            if ($value instanceof SwatDate && isset($value->year)) {
                // convert old dates to new dates
                $date_string = sprintf(
                    '%04d-%02d-%02dT%02d:%02d:%02d',
                    $value->year,
                    $value->month,
                    $value->day,
                    $value->hour,
                    $value->minute,
                    $value->second
                );

                $tz_id = $value->tz->id;

                $value = new SwatDate($date_string);
                $value->setTZById($tz_id);
            }

            if ($property === 'internal_properties') {
                // merge with null properties from init() so that newly
                // defined properties work on old serialized data.
                $this->$property = array_merge($this->$property, $value);
            } elseif (!isset($ignored_properties[$property])) {
                $this->$property = $value;
            }
        }
    }
654132
public function unserialize($data)
    {
        $value = @json_decode($data, true);
        
        if (!$value) {
            $value = array();
        }

        $this->append($value);
    }
597554
public function unserialize($data)
    {
        ClosureStream::register();

        if (static::$securityProvider !== null) {
            if ($data[0] !== '@') {
                throw new SecurityException("The serialized closure is not signed. ".
                    "Make sure you use a security provider for both serialization and unserialization.");
            }

            $data = json_decode(substr($data, 1), true);

            if (!is_array($data) || !static::$securityProvider->verify($data)) {
                throw new SecurityException("Your serialized closure might have been modified and it's unsafe to be unserialized. " .
                    "Make sure you use the same security provider, with the same settings, " .
                    "both for serialization and unserialization.");
            }

            $data = $data['closure'];
        } elseif ($data[0] === '@') {
            throw new SecurityException("The serialized closure is signed. ".
                "Make sure you use a security provider for both serialization and unserialization.");
        }

        $this->code = \unserialize($data);

        // unset data
        unset($data);

        $this->code['objects'] = array();

        if ($this->code['use']) {
            $this->scope = new ClosureScope();
            $this->code['use'] = $this->resolveUseVariables($this->code['use']);
            $this->mapPointers($this->code['use']);
            extract($this->code['use'], EXTR_OVERWRITE | EXTR_REFS);
            $this->scope = null;
        }

        $this->closure = include(ClosureStream::STREAM_PROTO . '://' . $this->code['function']);

        if($this->code['this'] === $this){
            $this->code['this'] = null;
        }

        if ($this->code['scope'] !== null || $this->code['this'] !== null) {
            $this->closure = $this->closure->bindTo($this->code['this'], $this->code['scope']);
        }

        if(!empty($this->code['objects'])){
            foreach ($this->code['objects'] as $item){
                $item['property']->setValue($item['instance'], $item['object']->getClosure());
            }
        }

        $this->code = $this->code['function'];
    }
486035
public static function unserialize( $data )
    {
        $data = json_decode( $data, true );
        return new static( $data[0], $data[1], $data[2], $data[3] );
    }
744103
public static function jsonUnserialize($data) {

		$report = null;

		if (!is_array($data)) {
			$data = (Array) json_decode($data, true);
		}

		if (count(array_intersect(['type', 'message', 'data'], array_keys($data))) == 3) {
			$report = new self($data['type'], $data['message'], $data['data']);
			if (isset($data['children']) && is_array($data['children'])) {
				foreach ($data['children'] as $child) {
					$report->add(static::jsonUnserialize($child));
				}
			}
		}

		return $report;
	}
545712
public function unserialize($data)
    {
        $connectionSettings = new ConnectionSettings( json_decode( $data, true ) );
        $this->__construct( $connectionSettings );
    }
566533
protected function _serialize($data)
	{
		if (is_array($data))
		{
			foreach ($data as $key => $val)
			{
				if (is_string($val))
				{
					$data[$key] = str_replace('\\', '{{slash}}', $val);
				}
			}
		}
		else
		{
			if (is_string($data))
			{
				$data = str_replace('\\', '{{slash}}', $data);
			}
		}

		return serialize($data);
	}
977156
public function unserialize($data)
    {
        $data = unserialize($data);

        $this->staticPath = $data['static_path'];
        $this->regex      = $data['regex'];
        $this->tokens     = $data['tokens'];
        $this->vars       = $data['vars'];
        $this->hostRegex  = $data['host_regex'];
        $this->hostVars   = $data['host_vars'];
        $this->hostTokens = $data['host_tokens'];
    }
696302
static function smartUnserialize(string $data)
    {
        try {
            $value = @unserialize($data);
        } catch (\Throwable $e) {
            throw new DeserializationFailedException('An exception was thrown during unserialization', 0, $e);
        }

        // distinguish between "false on error" and a serialized FALSE value
        if ($value === false && $data !== self::getSerializedFalse()) {
            throw new DeserializationFailedException('Unserialization failed - data possibly malformed');
        }

        return $value;
    }
28903
protected function _dataToSerialize($serialize = true)
    {
        if ($serialize === true) {
            $data = array_diff_key(
                $this->viewVars,
                array_flip($this->_specialVars)
            );

            if (empty($data)) {
                return null;
            }

            return $data;
        }

        if (is_array($serialize)) {
            $data = [];
            foreach ($serialize as $alias => $key) {
                if (is_numeric($alias)) {
                    $alias = $key;
                }
                if (array_key_exists($key, $this->viewVars)) {
                    $data[$alias] = $this->viewVars[$key];
                }
            }

            return !empty($data) ? $data : null;
        }

        return isset($this->viewVars[$serialize]) ? $this->viewVars[$serialize] : null;
    }