public function process(ContainerBuilder $container)
    {
        $this->documentMap = $container->get('graviton.document.map');

        $map = [];
        foreach ($this->documentMap->getDocuments() as $document) {
            $readOnlyFields = $this->documentMap->getFieldNamesFlat(
                $document,
                '',
                '',
                function ($field) {
                    return $field->isReadOnly();
                }
            );

            if (!empty($readOnlyFields)) {
                foreach ($readOnlyFields as $key => $readOnlyField) {
                    if (substr($readOnlyField, -2) == '.0') {
                        unset($readOnlyFields[$key]);
                    }
                }

                $map[$document->getClass()] = array_values($readOnlyFields);
            }
        }

        $container->setParameter('graviton.document.readonly.fields', $map);
    }