public static function create_from_category($category) {
        $event = self::create(array(
            'objectid' => $category->id,
            'context' => \context_system::instance(),
            'other' => array(
                'name' => $category->name,
            )
        ));

        $event->add_record_snapshot('user_info_category', $category);

        return $event;
    }
public static function create_from_category($category) {
        $event = self::create(array(
            'objectid' => $category->id,
            'context' => \context_system::instance(),
            'other' => array(
                'name' => $category->name,
            )
        ));

        $event->add_record_snapshot('user_info_category', $category);

        return $event;
    }
public static function create_from_category ( $ category ) { $ event = self :: create ( array ( 'objectid' => $ category -> id , 'context' => \ context_system :: instance ( ) , 'other' => array ( 'name' => $ category -> name , ) ) ) ; $ event -> add_record_snapshot ( 'user_info_category' , $ category ) ; return $ event ; }
Creates an event from a profile info category.

@since Moodle 3.4
@param \stdClass $category A sna[pshot of the created category.
@return \core\event\base
Creates an event from a profile info category .