getActivity()) { throw new \Exception('Cannot work with invoice items that do not have an activity'); } if (null === $invoiceItem->getActivity()->getId()) { throw new \Exception('Cannot handle un-persisted activities'); } return (string) $invoiceItem->getActivity()->getId(); } protected function mergeSumTimesheet(InvoiceItem $invoiceItem, InvoiceItemInterface $entry) { $invoiceItem->setActivity($entry->getActivity()); $invoiceItem->setDescription($entry->getActivity()->getName()); } /** * @return string */ public function getId(): string { return 'activity'; } }