定制 liventin/base.module.migration.userfields.provider.enumeration 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

liventin/base.module.migration.userfields.provider.enumeration

最新稳定版本:V1.0.0

Composer 安装命令:

composer require liventin/base.module.migration.userfields.provider.enumeration

包简介

Enumeration Provider for service migration bitrix userfield

README 文档

README

Bitrix Base Module Service Migration User Fields

install | update

"require": {
    "liventin/base.module.migration.userfields.provider.enumeration": "^1.0.0"
}

redirect (optional)

"extra": {
  "service-redirect": {
    "liventin/base.module.migration.userfields.provider.enumeration": "module.name",
  }
}

PhpStorm Live Template

<?php

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

use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Container;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Migration\UserField\UserFieldEntity;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Migration\UserField\UserFieldService;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Src\Migration\UserField\Providers\EnumerationProvider;
use Bitrix\Main\ObjectNotFoundException;
use Bitrix\Main\SystemException;
use Psr\Container\NotFoundExceptionInterface;
use ReflectionException;

class ExampleEnumerationUserField implements UserFieldEntity
{
    public static function getEntityId(): string
    {
        return 'USER';
    }

    public static function getFieldName(): string
    {
        return 'UF_EXAMPLE_ENUMERATION_FIELD';
    }

    public static function getUserTypeId(): string
    {
        return 'enumeration';
    }

    /**
     * @throws NotFoundExceptionInterface
     * @throws ObjectNotFoundException
     * @throws ReflectionException
     * @throws SystemException
     */
    public static function getParams(): array
    {
        /** @var EnumerationProvider ${DS}provider */
        ${DS}provider = Container::get(UserFieldService::SERVICE_CODE)->getProvider(self::getUserTypeId());

        ${DS}provider->createEnumValue()
            ->setValue('Значение 1')
            ->setXmlId('VALUE_1')
            ->setSort(321)
            ->setIsDefault(true);

        ${DS}provider->createEnumValue()
            ->setValue('Значение 2')
            ->setXmlId('VALUE_2')
            ->setSort(123);

        return ${DS}provider
            ->setSort(150)
            ->setMandatory(false)
            ->setShowFilter(true)
            ->setIsSearchable(true)
            ->setLabels('Дата и время пользователя')
            ->getParamsToArray();
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-06-18