I'm trying to get three properties from all the child objects that belongs to the parent object in Sonata Admin.
I have my parent object;
$parent = $this->admin->getSubject();
Then I want to get all the child objects from the parent object like this;
$children = $parent->getChildObjects;
How do I then create one array of three properties (all three properties are integers) from all the children objects together?
For example;
array(3) {
[0]=> '1-1-1'
[1]=> '1-1-2'
[2]=> '1-1-3'
[3]=> '1-2-1'
[4]=> '1-2-2'
[5]=> '1-2-3'
[6]=> '1-3-1'
[7]=> '1-3-2'
[8]=> '1-3-3'
[9]=> '2-1-1'
[10]=> '2-1-2'
[11]=> '2-1-3'
[12]=> '2-2-1'
[13]=> '2-2-2'
[14]=> '2-2-3'
[15]=> '2-3-1'
[16]=> '2-3-2'
[17]=> '2-3-3'
[18]=> '3-1-1'
[19]=> '3-1-2'
[20]=> '3-1-3'
[21]=> '3-2-1'
[22]=> '3-2-2'
[23]=> '3-2-3'
[24]=> '3-3-1'
[25]=> '3-3-2'
[26]=> '3-3-3'
}
Because what I want to do is, I want to create more children objects but it has to check in that array if that child does not yet exist in combination of the three propeties. If it does exist it should skip that number and try the next one in the loop.
How can I accomplish this? I'm fairly new with programming, and I only have a little bit of symfony and sonata knowledge.
If anybody has other ideas with other kind of array (multidimensional) for example, I stand open for different ideas.