public function getCompositions(SchemaBuilder $builder): array
    {
        $result = [];
        foreach ($this->reflection->getSchema() as $field => $type) {
            if (is_string($type) && $builder->hasSchema($type)) {
                $result[$field] = new CompositionDefinition(DocumentEntity::ONE, $type);
            }

            if (is_array($type) && isset($type[0]) && $builder->hasSchema($type[0])) {
                $result[$field] = new CompositionDefinition(DocumentEntity::MANY, $type[0]);
            }
        }

        return $result;
    }