shopware / shopware/shopware

Evaluate lazy objects for partial entity loading

Open
#13,922 0 comments 1 reaction 0 assignees View on GitHub
component/core domain/framework
Dominant language
PHP
Stars
3.4k
Forks
1.2k
Avg merge
3d 55m
Merged PRs (30d)
436

Description

### Technical TODO

With PHP 8.4 lazy objects were introduced https://www.php.net/manual/en/language.oop5.lazy-objects.php
In his talk on SymfonyCon '25 @beberlei talked about using this for loading partial entities in Doctrine ORM.
https://github.com/SymfonyCon/2025-talks?tab=readme-ov-file#how-native-lazy-objects-will-change-doctrine-and-symfony-forever
The objects have the same class as fully loaded objects, but only a few properties are set.
We should evaluate if we could exchange the [PartialEntity](https://github.com/shopware/shopware/blob/v6.7.5.0/src/Core/Framework/DataAbstractionLayer/PartialEntity.php) with this or a similar approach.
This gives the advantage, that we can still typehint normal entities instead a generic quite undefined one.

Contributor guide

Open the contributing guide

Research direction

Start by reading src/Core/Framework/DataAbstractionLayer/PartialEntity.php and the PHP 8.4 lazy objects documentation, then review the linked SymfonyCon talk for the proposed partial-entity approach. Done means producing an evaluation of whether PartialEntity can be replaced by lazy objects or a similar approach while retaining normal entity type hints.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.