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

1. Go to this page and download the library: Download liventin/base.module.migration.smart.process.workspace 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.workspace example snippets




/** @bxnolanginspection */

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


use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Container;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Migration\SmartProcessWorkspace\WorkspaceSmartProcessEntity;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\SmartProcess\SmartProcessService;
use Bitrix\Main\ObjectNotFoundException;
use Bitrix\Main\SystemException;
use Psr\Container\NotFoundExceptionInterface;
use ReflectionException;

class SmartProcessWorkspaceExample implements WorkspaceSmartProcessEntity
{
    public static function getTitle(): string
    {
        return 'title';
    }

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

        return [
            ${DS}srvSmartProcess->getByName(SmartProcessOne::getName())->getTypeId(),
            ${DS}srvSmartProcess->getByName(SmartProcessTwo::getName())->getTypeId(),
        ];
    }
}