Contributions 1 min read
New feature: DataObject::getBy system properties
We've built another Pimcore feature! Check out how Tomislav, our backend developer, created an entire new functionality.
What was the issue?
There are system variables that weren’t supported by any getBy method. That means that if anyone wanted to get for example a child of some object, he should create a new listing, add the condition for the parent and then get the objects from the listing.
How did you solve it?
Pimcore already had getByProperty for every property on an object and for some system predefined properties. Because I didn’t want to change any Pimcore functionality, the code is added after the old Pimcore code. Now instead of throwing an exception, first is checked if getBySystemProperty is actually a system property and if it is it does the same logic as with any other object property.
Why is this fix important?
For example, let’s say that a programmer wants to get all objects that are children of some other objects. He could create a new listing and set the condition and then get it from there, or he could create some service that needs to get injected into his class so he can reuse his getByParentId method. Now all he needs to do is call $object->getByParentId($parentId) to get all children of that object.
How does it feel to contribute to a platform such as Pimcore?
For now, most likely I will stick to providing pull requests for bug fixes or some minor improvements. Besides that, probably some articles about some of the Pimcore functionality that I see are interesting and useful. I wasn’t thinking about courses but now that you ask, yea maybe even some courses for beginners that want to start with Pimcore and don’t know how or where.
And if you want to check out this pull request, just follow the link!
Related
Contributions Object brick – Allowed classes sorting and filtering
Another day - another pull request! Our Pimcore developer, Dino, has made sure that Pimcore object bricks gain a new upgrade. Check it out! 1 min read
Contributions Fix to update object_url_slug to correct character set and collate
Check out our latest contribution the the Pimcore platform! Step by step, together we're building the ideal platform for the entire Pimcore community! 1 min read
Contributions Query builder – missing condition variables
Check out one of our pull request that's now officially a part of Pimcore's code! 1 min read
