public static function create_from_object(category_controller $category) : category_created {
        $eventparams = [
            'objectid' => $category->get('id'),
            'context'  => $category->get_handler()->get_configuration_context(),
            'other'    => ['name' => $category->get('name')]
        ];
        $event = self::create($eventparams);
        $event->add_record_snapshot($event->objecttable, $category->to_record());
        return $event;
    }
public static function create_from_object(category_controller $category) : category_created {
        $eventparams = [
            'objectid' => $category->get('id'),
            'context'  => $category->get_handler()->get_configuration_context(),
            'other'    => ['name' => $category->get('name')]
        ];
        $event = self::create($eventparams);
        $event->add_record_snapshot($event->objecttable, $category->to_record());
        return $event;
    }
public static function create_from_object ( category_controller $ category ) : category_created { $ eventparams = [ 'objectid' => $ category -> get ( 'id' ) , 'context' => $ category -> get_handler ( ) -> get_configuration_context ( ) , 'other' => [ 'name' => $ category -> get ( 'name' ) ] ] ; $ event = self :: create ( $ eventparams ) ; $ event -> add_record_snapshot ( $ event -> objecttable , $ category -> to_record ( ) ) ; return $ event ; }
Creates an instance from a category controller object

@param category_controller $category
@return category_created
Creates an instance from a category controller object