getUser()->getId()) { throw new \Exception('Cannot handle un-persisted user'); } return (string) $invoiceItem->getUser()->getId(); } /** * @return string */ public function getId(): string { return 'user'; } }