public function packSchema(): array
    {
        $result = [];
        foreach ($this->schemas as $class => $schema) {
            $item = [
                //Instantiator class
                ODMInterface::D_INSTANTIATOR  => $schema->getInstantiator(),

                //Primary collection class
                ODMInterface::D_PRIMARY_CLASS => $schema->resolvePrimary($this),

                //Instantiator and entity specific schema
                ODMInterface::D_SCHEMA        => $schema->packSchema($this),
            ];

            if (!$schema->isEmbedded()) {
                $item[ODMInterface::D_SOURCE_CLASS] = $this->getSource($class);
                $item[ODMInterface::D_DATABASE] = $schema->getDatabase();
                $item[ODMInterface::D_COLLECTION] = $schema->getCollection();
            }

            $result[$class] = $item;
        }

        return $result;
    }