pimcore / data-hub

Data delivery & consumption platform for Pimcore.
Other
128 stars 110 forks source link

Use factory for Pimcore object type instead static call. #900

Closed vmalyk closed 3 weeks ago

vmalyk commented 1 month ago

Hi,

It looks like Document and Asset have factories that generate QueryType and provide the ability to replace and extend entity schema definitions more easily. However, this does not work for Data Objects. I suggest adding a similar approach for Data Objects with its own factory, as we need to pass parameters, context, and class names without breaking the current implementation.

Please review.

vmalyk commented 4 weeks ago

Hi @mcop1,

thank you for feedback and I updated factory by using native types. I think it's better leave methods as protected and leave possibility to inherit new classes from factory and leave factory in the consistency with previously added factories.

Please have a look.

sonarcloud[bot] commented 4 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

mcop1 commented 3 weeks ago

Hello @vmalyk agreed, we can keep it consistent. I created a ticket to take a look at the classes and make them final/internal (if it is fitting) for the next major release.

Thank you again for your efforts!