protected function prepare_activity_structure($activitystructure) {

        // Create the wrap element
        $activity = new backup_nested_element('activity', array('id', 'moduleid', 'modulename', 'contextid'), null);

        // Build the tree
        $activity->add_child($activitystructure);

        // Set the source
        $activityarr = array((object)array(
            'id'         => $this->task->get_activityid(),
            'moduleid'   => $this->task->get_moduleid(),
            'modulename' => $this->task->get_modulename(),
            'contextid'  => $this->task->get_contextid()));

        $activity->set_source_array($activityarr);

        // Return the root element (activity)
        return $activity;
    }
protected function prepare_activity_structure($activitystructure) {

        // Create the wrap element
        $activity = new backup_nested_element('activity', array('id', 'moduleid', 'modulename', 'contextid'), null);

        // Build the tree
        $activity->add_child($activitystructure);

        // Set the source
        $activityarr = array((object)array(
            'id'         => $this->task->get_activityid(),
            'moduleid'   => $this->task->get_moduleid(),
            'modulename' => $this->task->get_modulename(),
            'contextid'  => $this->task->get_contextid()));

        $activity->set_source_array($activityarr);

        // Return the root element (activity)
        return $activity;
    }
protected function prepare_activity_structure ( $ activitystructure ) { // Create the wrap element $ activity = new backup_nested_element ( 'activity' , array ( 'id' , 'moduleid' , 'modulename' , 'contextid' ) , null ) ; // Build the tree $ activity -> add_child ( $ activitystructure ) ; // Set the source $ activityarr = array ( ( object ) array ( 'id' => $ this -> task -> get_activityid ( ) , 'moduleid' => $ this -> task -> get_moduleid ( ) , 'modulename' => $ this -> task -> get_modulename ( ) , 'contextid' => $ this -> task -> get_contextid ( ) ) ) ; $ activity -> set_source_array ( $ activityarr ) ; // Return the root element (activity) return $ activity ; }
Wraps any activity backup structure within the common 'activity' element
that will include common to all activities information like id, context...

@param backup_nested_element $activitystructure the element to wrap
@return backup_nested_element the $activitystructure wrapped by the common 'activity' element
Wraps any activity backup structure within the common activity element that will include common to all activities information like id context ...