Skip to content
Code-Schnipsel Gruppen Projekte
Commit c8a77a43 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

feat: Select all or only active manufacutre users (all by default).

Übergeordneter b00b2aec
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -42,9 +42,10 @@ public static function getManufacturerUserIds()
*
* @param int $limit (optional) - [default: all]
* @param int $offset (optional) [default: 0]
* @param bool $onlyActive (optional) - [default: get all users (active and inactive)]
* @return QUI\Interfaces\Users\User[]
*/
public static function getManufacturerUsers($limit = null, $offset = 0)
public static function getManufacturerUsers($limit = null, $offset = 0, $onlyActive = false)
{
$users = [];
......@@ -53,7 +54,13 @@ public static function getManufacturerUsers($limit = null, $offset = 0)
$userIds = \array_slice($userIds, $offset, $limit);
foreach ($userIds as $userId) {
$users[] = QUI::getUsers()->get($userId);
$User = QUI::getUsers()->get($userId);
if ($onlyActive && !$User->isActive()) {
continue;
}
$users[] = $User;
}
} catch (\Exception $Exception) {
QUI\System\Log::writeException($Exception);
......
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