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);
    }
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);
    }
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 ) ; }
Replaces content-content indexes for an array of contents.

@param array $contents An array of AbstractClassContent

@return \BackBee\ClassContent\Repository\IndexationRepository
Replaces content - content indexes for an array of contents .