public static function insertCategories($selectedCategories, $postID, $postTypeSlug)
    {
        if (count($selectedCategories)) {
            $categoriesIDs = [];
            $newCategoryRelation = [];
            foreach ($selectedCategories as $selectedCategory){
                $newCategoryRelation[] = [
                  'categoryID' => $selectedCategory['categoryID'],
                  'postID' => $postID,
                ];
                $categoriesIDs[] = $selectedCategory['categoryID'];
            }

            // if post is only in the archive
            // if post is in the main database
            $insertedCategories = (new CategoryRelation())->setTable($postTypeSlug.'_categories')->insert($newCategoryRelation);
            if ($insertedCategories) {
                return $categoriesIDs;
            }
        }
        return [];
    }