/** * @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; }
public function delete($object) { $this->validateModelClass($object); $this->dispatcher->dispatch(Events::BEFORE_CONTACT_DELETE, new ModelEvent($object)); parent::delete($object); }