diff --git a/src/QUI/ERP/Comments.php b/src/QUI/ERP/Comments.php index b240b5762bd1ccae77fb0e9ff4d78dfebdf832dd..573fef008c7bbed0ba204346ce559b1dfdddeab0 100644 --- a/src/QUI/ERP/Comments.php +++ b/src/QUI/ERP/Comments.php @@ -206,6 +206,8 @@ public function import(Comments $Comments) // region utils /** + * Get comments by user + * * @param QUI\Users\User $User * @return Comments * @@ -254,5 +256,28 @@ public static function getCommentsByUser(QUI\Users\User $User) return $Comments; } + /** + * Get history by user + * + * @param QUI\Users\User $User + * @return Comments + * + * @throws QUI\Exception + * @throws QUI\ExceptionStack + */ + public static function getHistoryByUser(QUI\Users\User $User) + { + $Comments = new self(); + + QUI::getEvents()->fireEvent( + 'quiqqerErpGetHistoryByUser', + [$User, $Comments] + ); + + $Comments->sort(); + + return $Comments; + } + // endregion }