Download the PHP package tourze/user-level-bundle without Composer
On this page you can find all versions of the php package tourze/user-level-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package user-level-bundle
User Level Bundle
中文
A Symfony bundle for managing user levels, upgrade rules, and level progression tracking.
Table of Contents
- Features
- Installation
- Configuration
- Dependencies
- Usage
- Advanced Usage
- API Reference
- Testing
- Contributing
- License
Features
- User Level Management: Create and manage different user levels
- Upgrade Rules: Define rules for level progression with customizable criteria
- Progress Tracking: Monitor user upgrade progress with detailed analytics
- Admin Interface: JSON-RPC procedures for level administration and management
- Doctrine Integration: Full ORM support with optimized repositories
- Validation: Comprehensive entity validation using Symfony constraints
- Extensible: Easy to extend with custom upgrade logic and rules
Installation
Install the bundle using Composer:
Enable the bundle in your config/bundles.php:
Update your database schema:
Configuration
The bundle works out of the box with minimal configuration. Service configuration is automatically loaded.
Optional Configuration
You can customize the bundle behavior in your config/packages/user_level.yaml:
Usage
Basic Usage
-
Create User Levels:
-
Define Upgrade Rules:
- Use the User Level Service:
Working with Repositories
Advanced Usage
Custom Upgrade Logic
Extend the UserLevelUpgradeService to implement custom upgrade logic:
Admin Procedures
The bundle provides JSON-RPC procedures for administration:
AdminCreateLevel: Create new user levelsAdminUpdateLevel: Update existing levelsAdminDeleteLevel: Delete levelsAdminGetLevelList: Get paginated list of levelsGetLevelLogsByBizUserId: Get user level assignment logs
Database Schema
The bundle creates the following tables:
biz_user_level: User levels configurationbiz_user_level_relation: User-level relationshipsbiz_user_level_upgrade_rule: Upgrade rulesbiz_user_level_upgrade_progress: User progress trackinguser_level_assign_log: Level assignment history
API Reference
Entities
- Level: Represents a user level with title and numeric value
- UserLevelRelation: Links users to their current levels
- UpgradeRule: Defines criteria for level progression
- UpgradeProgress: Tracks user progress towards next level
- AssignLog: Records level assignment history
Services
- UserLevelUpgradeService: Core service for handling level upgrades
Repositories
All entities have corresponding repositories with standard CRUD operations and custom query methods.
Testing
Run the test suite:
Run PHPStan analysis:
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure all tests pass and follow the existing code style.
Dependencies
This bundle requires:
System Requirements
- PHP 8.1 or higher
- Symfony 6.4+
- Doctrine ORM 3.0+
Core Dependencies
doctrine/collections: ^2.3doctrine/dbal: ^4.0doctrine/doctrine-bundle: ^2.13doctrine/orm: ^3.0symfony/config: ^6.4symfony/dependency-injection: ^6.4symfony/http-kernel: ^6.4symfony/security-core: ^6.4symfony/serializer: ^6.4
Tourze Bundle Dependencies
tourze/arrayable: 0.0.*tourze/bundle-dependency: 0.0.*tourze/doctrine-snowflake-bundle: 0.1.*tourze/doctrine-timestamp-bundle: 0.0.*tourze/doctrine-track-bundle: 0.1.*tourze/doctrine-user-bundle: 0.0.*tourze/json-rpc-core: 0.0.*tourze/json-rpc-log-bundle: 0.1.*tourze/json-rpc-paginator-bundle: 0.0.*
For a complete list of dependencies, see composer.json.
License
This bundle is released under the MIT license. See the LICENSE file for more information.
All versions of user-level-bundle with dependencies
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
easycorp/easyadmin-bundle Version ^4
knplabs/knp-menu Version ^3.7
symfony/config Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/http-kernel Version ^7.3
symfony/property-access Version ^7.3
symfony/routing Version ^7.3
symfony/security-core Version ^7.3
symfony/security-http Version ^7.3
symfony/serializer Version ^7.3
tourze/arrayable Version 1.*
tourze/bundle-dependency Version 1.*
tourze/doctrine-snowflake-bundle Version 1.1.*
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/doctrine-track-bundle Version 1.1.*
tourze/doctrine-user-bundle Version 1.0.*
tourze/easy-admin-menu-bundle Version 1.0.*
tourze/json-rpc-core Version 2.0.*
tourze/json-rpc-log-bundle Version 2.0.*
tourze/json-rpc-paginator-bundle Version 2.0.*
tourze/json-rpc-security-bundle Version 2.0.*
tourze/symfony-dependency-service-loader Version 1.0.*
tourze/symfony-routing-auto-loader-bundle Version 1.0.*
tourze/user-service-contracts Version 1.1.*