Closed attrib closed 2 years ago
Hi, thanks for the suggestion, I'd take a look
Hi @attrib I added a simple internal cache for src/Repository/Traits/EntityHydrator.php in this MR https://github.com/vienthuong/shopware-php-sdk/pull/36/files. Feel free to have a look to see if it solve the caching issue?
Looks good, thanks for the fast response.
If a search call is done with a custom definition, there will be a schema call for each entity of the results.
The reason for this is, that the InfoService is instantiated for each entity.
https://github.com/vienthuong/shopware-php-sdk/blob/196268493addaaae52b20356641e622bf107bedd/src/Repository/Traits/EntityHydrator.php#L18-L22
The InfoService has a internal cache, but that cache is non static.
Either the InfoService needs to be a singleton or cached somewhere (RepositoryFactory?) or the cache inside InfoService needs to be static.