tourze / doctrine-hostname-bundle
记录Hostname
0.0.2
2025-04-25 08:48 UTC
Requires
- php: ^8.1
- doctrine/doctrine-bundle: ^2.13
- doctrine/orm: ^2.20 || ^3.0
- doctrine/persistence: ^3.1 || ^4
- psr/log: ^3|^2|^1
- symfony/config: ^6.4
- symfony/dependency-injection: ^6.4
- symfony/framework-bundle: ^6.4
- symfony/http-kernel: ^6.4
- symfony/property-access: ^6.4
- symfony/yaml: ^6.4 || ^7.1
- tourze/bundle-dependency: 0.0.*
- tourze/doctrine-entity-checker-bundle: ~0.0.8
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-04-27 09:52:12 UTC
README
A Symfony bundle for automatically recording the hostname when creating or updating Doctrine entities.
Features
- Automatically records hostname on entity creation
- Automatically records hostname on entity update
- Configuration via PHP 8.1 attributes
- Integrates with Doctrine Entity Checker Bundle
Requirements
- PHP 8.1 or higher
- Symfony 6.4 or higher
- Doctrine Bundle 2.13 or higher
Installation
composer require tourze/doctrine-hostname-bundle
Quick Start
Add the attributes to your entity properties:
use Tourze\DoctrineHostnameBundle\Attribute\CreatedInHostColumn; use Tourze\DoctrineHostnameBundle\Attribute\UpdatedInHostColumn; class YourEntity { #[CreatedInHostColumn] private ?string $createdInHost = null; #[UpdatedInHostColumn] private ?string $updatedInHost = null; }
The bundle will automatically:
- Set
createdInHost
to the current hostname when the entity is created - Set
updatedInHost
to the current hostname when the entity is updated
Documentation
- Simple configuration via PHP attributes
- Customizable column names for hostname fields
- Fully compatible with other Tourze Doctrine extensions
Contributing
Feel free to submit issues and PRs. Please follow PSR code standards and provide relevant tests.
License
MIT License © Tourze
Changelog
See [CHANGELOG.md] for details (if available).