Download the PHP package tourze/doctrine-helper without Composer
On this page you can find all versions of the php package tourze/doctrine-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package doctrine-helper
Doctrine Helper
中文
A lightweight helper library to simplify and optimize your usage of Doctrine ORM in PHP projects.
Table of Contents
- Features
- Requirements
- Installation
- Quick Start
- Advanced Usage
- API Reference
- Contributing
- License
Features
- CacheHelper: Generate cache IDs and tags for Doctrine entities and objects with table name support
- EntityDetector: Determine whether a class is a Doctrine entity using attributes
- ReflectionHelper: Simplify reflection operations for Doctrine entities, properties, and custom attributes, with built-in caching for performance
- SortableTrait: Add sorting functionality to Doctrine entities with a simple trait
Requirements
- PHP >= 8.1
- doctrine/orm >= 3.0
- doctrine/common >= 3.5
- doctrine/dbal >= 4.0
Installation
Quick Start
CacheHelper Example
EntityDetector Example
ReflectionHelper Example
SortableTrait Example
Advanced Usage
Performance Features
- Reflection caching: All reflection operations are cached internally for better performance
- Attribute reading: Full support for PHP 8+ attributes
- Memory efficient: Optimized for minimal memory usage
Working with Attributes
The ReflectionHelper provides powerful methods for working with PHP 8+ attributes:
Cache Management
CacheHelper provides flexible caching strategies:
API Reference
CacheHelper
getClassId(string $className): stringgetClassTags(string $className, string $id = null): arraygetObjectTags(object $object): array
EntityDetector
isEntityClass(string $className): bool
ReflectionHelper
getClassReflection(object|string $object): \ReflectionClassgetReflectionProperty(object $object, string $propertyName): ?\ReflectionPropertygetProperties(object|string $object, $filter = null): arraygetMethods(object|string $object, $filter = null): arraygetParentClasses(\ReflectionClass $reflectionClass): arraygetPropertyAttributes(\ReflectionClass $reflectionClass, string $attributeName): arraygetPropertyAttribute(\ReflectionClass $reflectionClass, string $attributeName): ?objectgetClassAttributes(\ReflectionClass $reflectionClass, string $attributeName): \TraversablehasClassAttributes(\ReflectionClass $reflectionClass, string $attributeName): bool
SortableTrait
setSortNumber(int $sortNumber): selfgetSortNumber(): intretrieveSortableArray(): array
Contributing
- Issues and pull requests are welcome.
- Follow PSR-12 coding style.
- Ensure all PHPUnit tests pass before submitting.
License
MIT License. See LICENSE for details.
Changelog
See Git commit history for changes and releases.
All versions of doctrine-helper with dependencies
PHP Build Version
Package Version
The package tourze/doctrine-helper contains the following files
Loading the files please wait ...