public function buildFromConfigArray(array $config)
    {
        $cm = new CollectionManager();
        $collectionItemCollection = $cm->getCollectionItemCollection();

        foreach ($config as $collectionName => $attributes) {
            $path = $collectionName === 'pages' ? '' : $collectionName;

            if (is_array($attributes) === false) {
                throw new \RuntimeException(sprintf('Expected array at the collection: "%s".', $collectionName));
            }

            $collectionItemCollection->set($collectionName, new Collection($collectionName, $path, $attributes));
        }

        return $cm;
    }