public function unserialize($serialized)
    {
        $attributes = unserialize($serialized);

        $conn = Ioc::make(Pool::class)->getConnection();
        $db = $conn->defaultDatabase;
        $collectionObject = $conn->getRawConnection()->$db->{$attributes['collection']};

        foreach ($attributes as $key => $value) {
            $this->$key = $value;
        }

        $this->collection = $collectionObject;
    }
public function unserialize($serialized)
    {
        $attributes = unserialize($serialized);

        $conn = Ioc::make(Pool::class)->getConnection();
        $db = $conn->defaultDatabase;
        $collectionObject = $conn->getRawConnection()->$db->{$attributes['collection']};

        foreach ($attributes as $key => $value) {
            $this->$key = $value;
        }

        $this->collection = $collectionObject;
    }
public function unserialize ( $ serialized ) { $ attributes = unserialize ( $ serialized ) ; $ conn = Ioc :: make ( Pool :: class ) -> getConnection ( ) ; $ db = $ conn -> defaultDatabase ; $ collectionObject = $ conn -> getRawConnection ( ) -> $ db -> { $ attributes [ 'collection' ] } ; foreach ( $ attributes as $ key => $ value ) { $ this -> $ key = $ value ; } $ this -> collection = $ collectionObject ; }
Unserializes this object. Re-creating the database connection.

@param mixed $serialized serialized cursor
Unserializes this object . Re - creating the database connection .