private function childSortAlgorithm($a, $b)
{
$typePrefs = array();
$types = array(strtolower($a->getContentType()), strtolower($b->getContentType()));
foreach ($types as $type) {
$typePrefs[] = array_key_exists($type, $this->alternativePartOrder) ? $this->alternativePartOrder[$type] : max($this->alternativePartOrder) + 1;
}
return $typePrefs[0] >= $typePrefs[1] ? 1 : -1;
}