承接 integration-helper/integration-version 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

integration-helper/integration-version

最新稳定版本:1.0.24

Composer 安装命令:

composer require integration-helper/integration-version

包简介

Integration Helper with Version Data

README 文档

README

1.Implement interfaces:

IntegrationHelper\IntegrationVersion\Repository\IntegrationVersionItemRepositoryInterface $integrationVersionItemRepository

IntegrationHelper\IntegrationVersion\Repository\IntegrationVersionRepositoryInterface $integrationVersionRepository

IntegrationHelper\IntegrationVersion\DateTimeInterface $dateTime

IntegrationHelper\IntegrationVersion\GetterParentItemCollectionInterface $getterParentItemCollection

2. Use base Classes or Create your owns for:

IntegrationHelper\IntegrationVersion\HashGeneratorInterface $hashGenerator

IntegrationHelper\IntegrationVersion\IntegrationVersionManagerInterface $integrationVersionManager

IntegrationHelper\IntegrationVersion\IntegrationVersionItemManagerInterface $integrationVersionItemManager

Usage:

1. Init Class Context When Program starts

    $context = IntegrationHelper\IntegrationVersion\Context::getInstance();
    $context->setDateTime($dateTime);
    $context->setGetterParentItemCollection('default_getter_parent_item_collection', $defaultGetterParentItemCollection);
    $context->setGetterParentItemCollection($sourceCode, $getterParentItemCollection);
    $context->setHashGenerator($hashGenerator);
    $context->setIntegrationVersionManager($integrationVersionManager);
    $context->setIntegrationVersionItemManager($integrationVersionItemManager);
    $context->setIntegrationVersionItemRepository($integrationVersionItemRepository);
    $context->setIntegrationVersionRepository($integrationVersionRepository);

2. Create in migration script Integration Version

    $manager = Context::getIntegrationVersionManager();
    $source = 'products';
    $table = 'products';
    $identityColumn = 'id';
    $checksumColumns = ['sku', 'type', 'parent_id'];
    $manager->createOrUpdate(
        $source,
        $table,
        $identityColumn,
        $checksumColumns
    );

3. After Import Or Updated Data, just run build new version.

Full Reindex: 
    $source = 'products';
    $limit = 50000;

    $manager->setPendingStatus($source);
    $manager = Context::getIntegrationVersionManager();
    $manager->executeFull($source, $limit); //This process Get Items from IntegrationHelper\IntegrationVersion\GetterParentItemCollectionInterface,
     compare checksum and update hash and checksum
Reindex For One Item: 
    $source = 'products';
    $manager = Context::getIntegrationVersionManager();
    $manager->executeOne($source, $identityValue);

4. Get Identities For Update

    $source = {requestObject}->getParam('source');
    $oldHash = {requestObject}->getParam('previous_hash');
    $page = {requestObject}->getParam('page');
    $limit = {requestObject}->getParam('limit');
    $hashDateTime = {requestObject}->getParam('hash_date_time');

    $manager = Context::getIntegrationVersionItemManager();
    $identities = $manager->getIdentitiesForNewestVersions($source, $oldHash, $hashDateTime, $page, $limit);
    ....
    get Data from table or via collection by identity_column in ($identities) and return in response

Algorithm for Context::getIntegrationVersionItemManager()->getIdentitiesForNewestVersions($source, $oldHash, $hashDateTime, $page, $limit)

    Get Identities for items which newest than $hashDateTime and with hash not eq $oldHash

统计信息

  • 总下载量: 1.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固