uasort($array, function ($a, $b) {
$first = isset($a['question']['sort']) ? $a['question']['sort'] : $a['question_sub']['question']['sort'];
$second = isset($b['question']['sort']) ? $b['question']['sort'] : $b['question_sub']['question']['sort'];
if ($first == $second) {
return 0;
}
return ($first < $second) ? -1 : 1;
}
uasort($array, function($a, $b) {
if (isset($a['question']['sort'])) {
$first = $a['question']['sort'];
} else {
$first = $a['question_sub']['question']['sort'];
}
if (isset($b['question']['sort'])) {
$second = $b['question']['sort'];
} else {
$second = $b['question_sub']['question']['sort'];
}
if ($first == $second) {
return 0;
}
return ($first < $second) ? -1 : 1;
}
Возможно все дело в дополнительном ключе "--append" или "--env": DoctrineFixtures