public function replaceIdxContentContents(array $contents)
    {
        $parentUids = array();
        foreach ($contents as $content) {
            // avoid loop if content is already treated
            if (null === $content || true === $content->isElementContent()) {
                continue;
            } elseif (true === array_key_exists($content->getUid(), $parentUids)) {
                break;
            } elseif (false === array_key_exists($content->getUid(), $parentUids)) {
                $parentUids[$content->getUid()] = array($content->getUid());
            }

            $parentUids[$content->getUid()] = array_merge($parentUids[$content->getUid()], $this->getAClassContentUids($content->getSubcontent()->toArray()));
        }

        return $this->replaceIdxContentContentsByUids($parentUids);
    }