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;
    }
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;
    }
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 ; }
A helper to remember all model related data. Helps to ensure we consistently handle models in CRUD.

@param mixed                    $model
@param string                   $path
@param ModelSchemaInfoInterface $modelSchemas
@param ModelStorageInterface    $modelStorage
@param TagStorageInterface      $modelsAtPath
@param ArrayObject              $idsAtPath

@return mixed
A helper to remember all model related data . Helps to ensure we consistently handle models in CRUD .