tourze / device-bundle
设备管理
Installs: 107
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- doctrine/collections: ^2.3
- doctrine/dbal: ^4.0
- doctrine/doctrine-bundle: ^2.13
- doctrine/orm: ^3.0
- doctrine/persistence: ^3.1 || ^4
- symfony/config: ^6.4
- symfony/dependency-injection: ^6.4
- symfony/framework-bundle: ^6.4
- symfony/http-kernel: ^6.4
- symfony/routing: ^6.4
- symfony/security-core: ^6.4
- symfony/yaml: ^6.4 || ^7.1
- tourze/doctrine-snowflake-bundle: 0.1.*
- tourze/doctrine-track-bundle: 0.1.*
- tourze/easy-admin-attribute: 0.1.*
- tourze/easy-admin-extra-bundle: 0.1.*
- tourze/symfony-routing-auto-loader-bundle: 0.0.*
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.0
README
简介
DeviceBundle 提供设备管理功能。
功能
- 设备注册与管理
- 设备与用户关联
数据填充 (Fixtures)
DeviceBundle 提供了一组数据填充工具,用于生成测试/开发环境所需的初始数据。
可用的 Fixtures
DeviceFixtures: 创建测试设备数据
使用方法
在项目根目录执行以下命令加载所有 fixtures:
php bin/console doctrine:fixtures:load
仅加载设备相关 fixture:
php bin/console doctrine:fixtures:load --group=device
添加数据而不清空数据库:
php bin/console doctrine:fixtures:load --append
引用关系
在开发自定义 fixtures 时,可以使用以下常量引用已创建的设备实体:
DeviceFixtures::DEVICE_REFERENCE_1
(iPhone 设备)DeviceFixtures::DEVICE_REFERENCE_2
(Samsung 设备)DeviceFixtures::DEVICE_REFERENCE_3
(Xiaomi 设备,无效状态)