PHP code example of liventin / base.module.migration.smart.process

1. Go to this page and download the library: Download liventin/base.module.migration.smart.process library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

liventin / base.module.migration.smart.process example snippets




namespace ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Migration\SmartProcess;


use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Container;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Migration\SmartProcess\MigrateSmartProcessEntity;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Migration\SmartProcess\MigrateSmartProcessService;
use Bitrix\Main\ObjectNotFoundException;
use Bitrix\Main\SystemException;
use Psr\Container\NotFoundExceptionInterface;
use ReflectionException;

class SmartProcessExample implements MigrateSmartProcessEntity
{
    public static function getName(): string
    {
        return 'ExampleName';
    }

    public static function getTitle(): string
    {
        return 'ExampleTitle';
    }

    public static function getCode(): string
    {
        return 'EXAMPLE_CODE';
    }

    /**
     * @throws NotFoundExceptionInterface
     * @throws ObjectNotFoundException
     * @throws ReflectionException
     * @throws SystemException
     */
    public static function getParams(): array
    {
        /** @var MigrateSmartProcessService ${DS}service */
        ${DS}service = Container::get(MigrateSmartProcessService::SERVICE_CODE);

        /** @var ParamsConstructor ${DS}config */
        ${DS}config = ${DS}service->getParamsConstructor();

        return ${DS}config
            ->setIsUseInUserfieldEnabled()
            ->getParamsInArray();
    }
}