Skip to content
Code-Schnipsel Gruppen Projekte
Commit 989d93c4 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: getCommentsByUser

Übergeordneter 1f0643e1
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -146,4 +146,42 @@ public function import(Comments $Comments)
$this->sort();
}
// region utils
/**
* @param QUI\Users\User $User
* @return Comments
*
* @throws QUI\Exception
* @throws QUI\ExceptionStack
*/
public static function getCommentsByUser(QUI\Users\User $User)
{
$Comments = null;
if ($User->getAttribute('comments')) {
$json = \json_decode($User->getAttribute('comments'), true);
if (\is_array($json)) {
$Comments = new self($json);
}
}
if ($Comments === null) {
$Comments = new self();
}
QUI::getEvents()->fireEvent(
'quiqqerErpGetCommentsByUser',
[$User, $Comments]
);
$Comments->sort();
return $Comments;
}
// endregion
}
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren