-
Couldn't load subscription status.
- Fork 4
Added back-end unit tests for all controllers, services and more #593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
a93e7e5
69b49a8
af63b0a
722b49c
b1d3b3b
da19daa
5375f8b
9a263c6
8aee6cc
4f3acc0
a8d5a58
e685484
6e4d234
d538038
9690133
c53469e
3903d54
0276cc8
fc417bb
5b874f7
1792fbb
d9243f5
71aac87
d38152a
9db9138
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [submodule "3rdparty"] | ||
| shallow = true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,14 +273,13 @@ public function export( | |
| $logs = $this->synchronizationLogMapper->findAll(null, null, $filters); | ||
|
|
||
| // Create CSV content | ||
| $csvData = "ID,UUID,Level,Message,Synchronization ID,User ID,Session ID,Created,Expires\n"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Synchronizations don't have a property called level |
||
| $csvData = "ID,UUID,Message,Synchronization ID,User ID,Session ID,Created,Expires\n"; | ||
|
|
||
| foreach ($logs as $log) { | ||
| $csvData .= sprintf( | ||
| "%s,%s,%s,%s,%s,%s,%s,%s,%s\n", | ||
| "%s,%s,%s,%s,%s,%s,%s,%s\n", | ||
| $log->getId() ?? '', | ||
| $log->getUuid() ?? '', | ||
| $log->getLevel() ?? '', | ||
| '"' . str_replace('"', '""', $log->getMessage() ?? '') . '"', | ||
| $log->getSynchronizationId() ?? '', | ||
| $log->getUserId() ?? '', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,25 @@ public function find(int|string $id): Source | |
| return $this->findEntity(query: $qb); | ||
| } | ||
|
|
||
| /** | ||
| * Find all sources that belong to a specific reference. | ||
| * | ||
| * @param string $reference The reference to find sources for | ||
| * @return array<Source> Array of Source entities | ||
| */ | ||
| public function findByRef(string $reference): array | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rubenvdlinde ik kan op OpenConnector geen Sources meer importeren omdat de findByRef function op de SourceMapper niet meer bestaat
|
||
| { | ||
| $qb = $this->db->getQueryBuilder(); | ||
|
|
||
| $qb->select('*') | ||
| ->from('openconnector_sources') | ||
| ->where( | ||
| $qb->expr()->eq('reference', $qb->createNamedParameter($reference)) | ||
| ); | ||
|
|
||
| return $this->findEntities(query: $qb); | ||
| } | ||
|
|
||
| /** | ||
| * Find all sources matching the given criteria | ||
| * | ||
|
|
@@ -159,22 +178,33 @@ public function updateFromArray(int $id, array $object): Source | |
| } | ||
|
|
||
| /** | ||
| * Get the total count of all call logs. | ||
| * Get the total count of all sources. | ||
| * | ||
| * @return int The total number of call logs in the database. | ||
| * @param array $filters Optional filters to apply | ||
| * @return int The total number of sources in the database. | ||
| */ | ||
| public function getTotalCallCount(): int | ||
| public function getTotalCount(array $filters = []): int | ||
| { | ||
| $qb = $this->db->getQueryBuilder(); | ||
|
|
||
| // Select count of all logs | ||
| // Select count of all sources | ||
| $qb->select($qb->createFunction('COUNT(*) as count')) | ||
| ->from('openconnector_sources'); | ||
|
|
||
| // Apply filters if provided | ||
| foreach ($filters as $filter => $value) { | ||
| if ($value === 'IS NOT NULL') { | ||
| $qb->andWhere($qb->expr()->isNotNull($filter)); | ||
| } elseif ($value === 'IS NULL') { | ||
| $qb->andWhere($qb->expr()->isNull($filter)); | ||
| } else { | ||
| $qb->andWhere($qb->expr()->eq($filter, $qb->createNamedParameter($value))); | ||
| } | ||
| } | ||
|
|
||
| $result = $qb->execute(); | ||
| $row = $result->fetch(); | ||
|
|
||
| // Return the total count | ||
| return (int)$row['count']; | ||
| } | ||
|
|
||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.