public function getActiveView()
{
$index = $this->getActiveViewIndex();
$views = $this->getViews();
if ($index >= $views->getCount()) {
throw new TInvalidDataValueException('multiview_activeviewindex_invalid', $index);
}
if ($index < 0) {
return null;
}
$view = $views->itemAt($index);
if (!$view->getActive()) {
$this->activateView($view, false);
}
return $view;
}