Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 5289f8b

Browse files
author
Dominik František Bučík
authored
Merge pull request #85 from dBucik/dev
fix: 🐛 Fix parameters ordering and duplicate insert
2 parents 94ef966 + ceef3ee commit 5289f8b

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

lib/DatabaseCommand.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,6 @@ public function insertLoginFromFilter($request, $date)
8282
$entities = $this->getEntities($request);
8383
$userId = $this->getUserId($request);
8484
$this->insertLogin($entities, $userId, $date);
85-
86-
$ids = [];
87-
foreach (self::TABLE_SIDES as $side => $table) {
88-
$tableId = self::TABLE_IDS[$table];
89-
$ids[$tableId] = $this->getEntityDbIdFromEntityIdentifier($table, $entities[$side], $tableId);
90-
}
91-
92-
if (!$this->writeLogin($date, $ids, $userId)) {
93-
Logger::error(self::DEBUG_PREFIX . 'login record has not been inserted (data \'' . json_encode([
94-
'user' => $userId,
95-
'ids' => $ids,
96-
'date' => $date,
97-
]) . '\'.');
98-
}
9985
}
10086

10187
public function insertLoginFromApi($data, DateTime $date)
@@ -407,7 +393,7 @@ private function getEntities($request): array
407393
return $this->prepareEntitiesStructure($idpIdentifier, $idpName, $spIdentifier, $spName);
408394
}
409395

410-
private function prepareEntitiesStructure($idpIdentifier, $idpName, $spName, $spIdentifier): array
396+
private function prepareEntitiesStructure($idpIdentifier, $idpName, $spIdentifier, $spName): array
411397
{
412398
$entities = [
413399
Config::MODE_IDP => [],

0 commit comments

Comments
 (0)