This question already has an answer here:
This is my first post here, and my first month of learning Magento 2.
I've been able to create configurable and simple products using PHP, but I can't find a way to associate those simple products to a configurable product. The only resource I've found about it is this one.
But still, I couldn't make it work.
Basically I've created a custom product attribute for the sizes (later on I'll manually look into how to do it programmatically) and I have created products so that the end result is that you see one product of which you can choose multiple sizes.
This is just like Magento 2 with sample data. I've learned how to do it manually but I couldn't find out how to do it programmatically with PHP.
Are there any pointers that could help me solve this issue?