public function duplicate()
    {
        $class = get_class($this);
        $new_wrapper = new $class();

        foreach ($this->getArray() as $object) {
            $object->setDatabase($this->db);
            $duplicate_object = $object->duplicate();
            $duplicate_object->setDatabase($this->db);
            $new_wrapper->add($duplicate_object);
        }

        $new_wrapper->setDatabase($this->db);

        return $new_wrapper;
    }