src/Sulu/Component/Media/SystemCollections/SystemCollectionManager.php
private function buildSystemCollections($locale, $userId)
    {
        $root = $this->getOrCreateRoot(SystemCollectionManagerInterface::COLLECTION_KEY, 'System', $locale, $userId);
        $collections = ['root' => $root->getId()];
        $collections = array_merge($collections, $this->iterateOverCollections($this->config, $userId, $root->getId()));

        $this->entityManager->flush();

        return $collections;
    }
private function buildSystemCollections($locale, $userId)
    {
        $root = $this->getOrCreateRoot(SystemCollectionManagerInterface::COLLECTION_KEY, 'System', $locale, $userId);
        $collections = ['root' => $root->getId()];
        $collections = array_merge($collections, $this->iterateOverCollections($this->config, $userId, $root->getId()));

        $this->entityManager->flush();

        return $collections;
    }
private function buildSystemCollections ( $ locale , $ userId ) { $ root = $ this -> getOrCreateRoot ( SystemCollectionManagerInterface :: COLLECTION_KEY , 'System' , $ locale , $ userId ) ; $ collections = [ 'root' => $ root -> getId ( ) ] ; $ collections = array_merge ( $ collections , $ this -> iterateOverCollections ( $ this -> config , $ userId , $ root -> getId ( ) ) ) ; $ this -> entityManager -> flush ( ) ; return $ collections ; }
Go thru configuration and build all system collections.

@param string $locale
@param int $userId

@return array
Go thru configuration and build all system collections .