private function getContactType() { $viewModel = $this->renderer->viewModel()->getCurrent(); $viewModelChildren = $viewModel->getChildren(); $pageModel = $viewModelChildren[0]; $company = $pageModel->getVariable('company'); if ($company !== null) { return ContactEntry::TYPE_COMPANY; } $person = $pageModel->getVariable('person'); if ($person !== null) { return ContactEntry::TYPE_PERSON; } return ContactEntry::TYPE_UNKNOWN; }
private function getContact() { $viewModel = $this->renderer->viewModel()->getCurrent(); $viewModelChildren = $viewModel->getChildren(); $pageModel = $viewModelChildren[0]; $company = $pageModel->getVariable('company'); if ($company !== null) { return $company; } $person = $pageModel->getVariable('person'); if ($person !== null) { return $person; } return null; }