Download the PHP package vuryss/doctrine-lazy-json-odm without Composer
On this page you can find all versions of the php package vuryss/doctrine-lazy-json-odm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vuryss/doctrine-lazy-json-odm
More information about vuryss/doctrine-lazy-json-odm
Files in vuryss/doctrine-lazy-json-odm
Package doctrine-lazy-json-odm
Short Description A high-performance Doctrine JSON ODM with lazy loading using vuryss/serializer v4
License MIT
Informations about the package doctrine-lazy-json-odm
Doctrine Lazy JSON ODM Bundle
A high-performance Symfony bundle that provides a Doctrine JSON ODM (Object Document Mapper) with advanced lazy loading capabilities. This bundle stores complex object structures as JSON in database fields while providing transparent lazy loading to improve performance.
Features
- 🚀 Lazy Loading: Uses PHP 8.5 lazy objects for deferred JSON deserialization
- ⚡ Serializer: Uses vuryss/serializer v4 for maximum performance
- 🎯 Type Mapping: Map class names to aliases for storage optimization
- 📦 Collection Support: Lazy-loaded arrays of objects with transparent usage
- 📊 Performance Optimized: Significant memory and CPU savings for unused data
Requirements
- PHP 8.5 or higher
- Symfony 7.4 LTS or 8.x
- Doctrine ORM 3.6+
Installation
Install the bundle via Composer:
Register the bundle in your config/bundles.php:
Configuration
Create a configuration file config/packages/doctrine_lazy_json_odm.yaml:
Usage
Basic Entity Definition
Define your entities with JSON ODM fields using the LazyJsonDocumentType:
Value Objects for JSON Storage
Create readonly classes for your JSON-stored objects:
Working with Entities
Working with Lazy Arrays
Advanced Configuration
Configure type aliases for optimized storage:
Performance Optimization
Development
Start the local development container and run repository commands inside it:
Run the default quality suite against the latest allowed dependencies:
Validate both supported Symfony lines from the same composer.json:
Performance Considerations
Memory Efficiency
- Lazy Loading: Objects are only deserialized when accessed, saving memory for unused data
- Type Aliases: Short aliases can reduce JSON size significantly
- Selective Access: Access only the properties you need
Best Practices
- Use Type Aliases: Configure short, meaningful aliases for frequently used classes
- Cache Configuration: Configure metadata caching for optimal performance
Benchmarks
Code Quality
The bundle maintains high code quality standards:
Contributing
- Fork the repository
- Create a feature branch
- Add tests for your changes
- Ensure all tests pass
- Run code quality tools
- Submit a pull request
License
This bundle is released under the MIT License. See the LICENSE file for details.
Credits
- Inspired by dunglas/doctrine-json-odm
- Uses vuryss/serializer for high-performance serialization
- Built with PHP 8.5 lazy objects feature
All versions of doctrine-lazy-json-odm with dependencies
doctrine/dbal Version ^4.4.2
doctrine/orm Version ^3.6.2
symfony/framework-bundle Version ^7.4 || ^8.0
symfony/dependency-injection Version ^7.4 || ^8.0
symfony/config Version ^7.4 || ^8.0
vuryss/serializer Version ^4.0
halaxa/json-machine Version ^1.2.6