public function getNavigations($indexBy = null, $indexAllData = false)
{
$navigationRecords = AmNav_NavigationRecord::model()->ordered()->findAll();
$navigations = AmNav_NavigationModel::populateModels($navigationRecords);
if ($indexBy !== null) {
$indexedNavigations = array();
foreach ($navigations as $navigation) {
$indexedNavigations[$navigation->{$indexBy}] = $indexAllData ? $navigation : $navigation->name;
}
return $indexedNavigations;
}
return $navigations;
}