protected function resolveWhen($default_when) { if ($this->Appointment) { $this->Appointment->setDefaultWhen($default_when); } return $this->Appointment ? $this->Appointment->getWhen() : null; }