public static function save_category(category_controller $category) {
        $isnewcategory = empty($category->get('id'));

        $category->save();

        if ($isnewcategory) {
            // Move to the end.
            self::move_category($category);
            category_created::create_from_object($category)->trigger();
        } else {
            category_updated::create_from_object($category)->trigger();
        }
    }
public static function save_category(category_controller $category) {
        $isnewcategory = empty($category->get('id'));

        $category->save();

        if ($isnewcategory) {
            // Move to the end.
            self::move_category($category);
            category_created::create_from_object($category)->trigger();
        } else {
            category_updated::create_from_object($category)->trigger();
        }
    }
public static function save_category ( category_controller $ category ) { $ isnewcategory = empty ( $ category -> get ( 'id' ) ) ; $ category -> save ( ) ; if ( $ isnewcategory ) { // Move to the end. self :: move_category ( $ category ) ; category_created :: create_from_object ( $ category ) -> trigger ( ) ; } else { category_updated :: create_from_object ( $ category ) -> trigger ( ) ; } }
Insert or update custom field category

@param category_controller $category
Insert or update custom field category