public function makeDefinition()
    {
        //Find only first level children stored in the same collection
        $children = $this->findChildren(true, true);

        if (empty($children)) {
            //Nothing to inherit
            return $this->schema->getClass();
        }

        //We must sort child in order or unique fields
        uasort($children, [$this, 'sortChildren']);

        //Fields which are common for parent and child models
        $commonFields = $this->schema->getReflection()->getSchema();

        $definition = [];
        foreach ($children as $schema) {
            //Child document fields
            $fields = $schema->getReflection()->getSchema();

            if (empty($fields)) {
                throw new DefinitionException(
                    "Child document '{$schema->getClass()}' of '{$this->schema->getClass()}' does not have any fields"
                );
            }

            $uniqueField = null;
            if (empty($commonFields)) {
                //Parent did not declare any fields, happen sometimes
                $commonFields = $fields;
                $uniqueField = key($fields);
            } else {
                foreach ($fields as $field => $type) {
                    if (!isset($commonFields[$field])) {
                        if (empty($uniqueField)) {
                            $uniqueField = $field;
                        }

                        //New non unique field (must be excluded from analysis)
                        $commonFields[$field] = true;
                    }
                }
            }

            if (empty($uniqueField)) {
                throw new DefinitionException(
                    "Child document '{$schema->getClass()}' of '{$this->schema->getClass()}' does not have any unique field"
                );
            }

            $definition[$uniqueField] = $schema->getClass();
        }

        return $definition;
    }