protected function populate() { parent::populate(); $parent = $this->object->getParent(); if (!is_null($parent)) { $values = ['Parent' => $parent->getId()]; } $values['Done'] = $this->object->isDone(); $this->form->populate($values); }
protected function populate() { parent::populate(); $values = []; if ($start = $this->object->getStart()) { $values['Start-Date'] = $this->toDate($start); $values['Start-Time'] = $this->toTime($start); } if (!$this->object->isRunning() && ($end = $this->object->getEnd())) { $values['End-Date'] = $this->toDate($end); $values['End-Time'] = $this->toTime($end); } $this->form->populate($values); }