/**
  * Get the page model
  *
  * @param int $id
  *
  * @return PageModel|null
  */
 protected function getPageModel($id)
 {
     if (($eventModel = CalendarEventsModel::findByPk($id)) === null) {
         return '';
     }
     if (($calendarModel = CalendarModel::findByPk($eventModel->pid)) === null) {
         return '';
     }
     return PageModel::findByPk($calendarModel->jumpTo);
 }
 /**
  * Generate missing translation warning for calendar events child records.
  *
  * @param array $args
  * @param mixed $previousResult
  *
  * @return string
  */
 public function onCalendarEventChildRecords(array $args, $previousResult = null)
 {
     $row = $args[0];
     $label = (string) $previousResult;
     $calendar = CalendarModel::findByPk($row['pid']);
     if ($calendar->master && (!$row['languageMain'] || null === CalendarEventsModel::findByPk($row['languageMain']))) {
         return $this->generateLabelWithWarning($label);
     }
     return $label;
 }