/** * @see \Devture\Component\DBAL\Repository\BaseRepository::exportModel() * @param $model Contact */ protected function exportModel($model) { $export = parent::exportModel($model); $timePeriod = $model->getTimePeriod(); $export['timePeriodId'] = $timePeriod instanceof TimePeriod ? $timePeriod->getId() : null; $command = $model->getServiceNotificationCommand(); $export['serviceNotificationCommandId'] = $command instanceof Command ? $command->getId() : null; $user = $model->getUser(); $export['userId'] = $user instanceof User ? $user->getId() : null; return $export; }
/** * @see \Devture\Component\DBAL\Repository\BaseRepository::exportModel() */ protected function exportModel($model) { $export = parent::exportModel($model); $host = $model->getHost(); $export['hostId'] = $host instanceof Host ? $host->getId() : null; $command = $model->getCommand(); $export['commandId'] = $command instanceof Command ? $command->getId() : null; $export['contactsIds'] = array_map(function (Contact $contact) { return $contact->getId(); }, $model->getContacts()); return $export; }
/** * @param User $model * @return array */ protected function exportModel($model) { $data = parent::exportModel($model); $data['email'] = $model->getEmail() ? $model->getEmail() : null; return $data; }