private function resetCraftCategoriesServiceCache()
{
$obj = Craft::app()->categories;
$refObject = new \ReflectionObject($obj);
if ($refObject->hasProperty('_fetchedAllCategoryGroups')) {
$refProperty = $refObject->getProperty('_fetchedAllCategoryGroups');
$refProperty->setAccessible(true);
$refProperty->setValue($obj, false);
}
if ($refObject->hasProperty('_categoryGroupsById')) {
$refProperty = $refObject->getProperty('_categoryGroupsById');
$refProperty->setAccessible(true);
$refProperty->setValue($obj, array());
}
}