Elgg\Notifications\EventSerialization::unserialize PHP Method

unserialize() public method

Unserializes the event object stored in the database
public unserialize ( string $serialized ) : string
$serialized string Serialized string
return string
    public function unserialize($serialized)
    {
        $data = unserialize($serialized);
        if (isset($data->action)) {
            $this->action = $data->action;
        }
        if (isset($data->object_id) && isset($data->object_type)) {
            switch ($data->object_type) {
                case 'object':
                case 'user':
                case 'group':
                case 'site':
                    $this->object = get_entity($data->object_id);
                    break;
                case 'annotation':
                    $this->object = elgg_get_annotation_from_id($data->object_id);
                    break;
                case 'metadata':
                    $this->object = elgg_get_metadata_from_id($data->object_id);
                    break;
                case 'relationship':
                    $this->object = get_relationship($data->object_id);
            }
        }
        if (isset($data->actor_guid)) {
            $this->actor = get_entity($data->actor_guid);
        }
    }
EventSerialization