public function loadChilds(Element\ElementInterface $element)
{
$this->amount++;
Element\Service::loadAllFields($element);
// for all
$element->getProperties();
if (method_exists($element, "getScheduledTasks")) {
$element->getScheduledTasks();
}
$element->_fulldump = true;
// we need to add the tag of each item to the cache cleared stack, so that the item doesn't gets into the cache
// with the property _fulldump set, because this would cause major issues in wakeUp()
\Pimcore\Cache::addClearedTag($element->getCacheTag());
if (method_exists($element, "getChilds")) {
if ($element instanceof Object\AbstractObject) {
// because we also want variants
$childs = $element->getChilds([Object::OBJECT_TYPE_FOLDER, Object::OBJECT_TYPE_VARIANT, Object::OBJECT_TYPE_OBJECT]);
} else {
$childs = $element->getChilds();
}
foreach ($childs as $child) {
$this->loadChilds($child);
}
}
}