private static function registerModelAtPath(
        $model,
        string $path,
        ModelSchemaInfoInterface $modelSchemas,
        ModelStorageInterface $modelStorage,
        TagStorageInterface $modelsAtPath,
        ArrayObject $idsAtPath
    ) {
        $uniqueModel = $modelStorage->register($model);
        if ($uniqueModel !== null) {
            $modelsAtPath->register($uniqueModel, $path);
            $pkName             = $modelSchemas->getPrimaryKey(get_class($uniqueModel));
            $modelId            = $uniqueModel->{$pkName};
            $idsAtPath[$path][] = $modelId;
        }

        return $uniqueModel;
    }