Skip to content

Commit 6d64260

Browse files
author
MTier Ltd
committed
ship our own 'old' nextcloud db mapper; based on the idea from the Music app, thanks
fixes mtierltd#210
1 parent ee3200b commit 6d64260

15 files changed

+402
-33
lines changed

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Diese App wird aktuell noch weiterentwickelt, also: Augen offen halten für neue
5353
<screenshot>https://abload.de/img/bildschirmfotoam2021-vuk8t.png</screenshot>
5454
<screenshot>https://abload.de/img/bildschirmfotoam2021-03kxw.png</screenshot>
5555
<dependencies>
56-
<nextcloud min-version="20" max-version="25"/>
56+
<nextcloud min-version="20" max-version="26"/>
5757
</dependencies>
5858
<navigations>
5959
<navigation>

lib/AppInfo/Application.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ class Application extends App {
2525
*/
2626
public function __construct(array $urlParams=array()){
2727
parent::__construct('timetracker', $urlParams);
28+
29+
if (!\class_exists('\OCA\TimeTracker\Db\CompatibleMapper')) {
30+
if (\class_exists(\OCP\AppFramework\Db\Mapper::class)) {
31+
\class_alias(\OCP\AppFramework\Db\Mapper::class, 'OCA\TimeTracker\Db\CompatibleMapper');
32+
} else {
33+
\class_alias(\OCA\TimeTracker\Db\OldNextcloudMapper::class, 'OCA\TimeTracker\Db\CompatibleMapper');
34+
}
35+
}
36+
2837
$container = $this->getContainer();
2938
/**
3039
* Controllers
@@ -44,4 +53,4 @@ public function __construct(array $urlParams=array()){
4453
});
4554

4655
}
47-
}
56+
}

lib/Db/ClientMapper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
namespace OCA\TimeTracker\Db;
55

66
use OCP\IDBConnection;
7-
use OCP\AppFramework\Db\Mapper;
87

9-
class ClientMapper extends Mapper {
8+
class ClientMapper extends CompatibleMapper {
109

1110
public function __construct(IDBConnection $db) {
1211
parent::__construct($db, 'timetracker_client');

lib/Db/GoalMapper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
namespace OCA\TimeTracker\Db;
55

66
use OCP\IDBConnection;
7-
use OCP\AppFramework\Db\Mapper;
87

9-
class GoalMapper extends Mapper {
8+
class GoalMapper extends CompatibleMapper {
109

1110
public function __construct(IDBConnection $db) {
1211
parent::__construct($db, 'timetracker_goal');
@@ -43,4 +42,4 @@ public function findAll($user){
4342
}
4443

4544

46-
}
45+
}

0 commit comments

Comments
 (0)