Skip to content

Commit 60367d4

Browse files
committed
removing countIncremental
1 parent b66df99 commit 60367d4

File tree

4 files changed

+3
-52
lines changed

4 files changed

+3
-52
lines changed

lib/Command/PointList.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
130130
$output = new ConsoleOutput();
131131
$output = $output->section();
132132
$table = new Table($output);
133-
$table->setHeaders(['Id', 'Parent', 'Children', 'Date']);
133+
$table->setHeaders(['Id', 'Parent', 'Date']);
134134
$table->render();
135135

136136
foreach ($points as $point) {
137137
$table->appendRow(
138138
[
139139
$point->getId(),
140140
$point->getParent(),
141-
$point->getCountIncremental(),
142141
date('Y-m-d H:i:s', $point->getDate())
143142
]
144143
);

lib/Db/CoreQueryBuilder.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
namespace OCA\Backup\Db;
3333

3434
use ArtificialOwl\MySmallPhpTools\Db\Nextcloud\nc23\NC23ExtendedQueryBuilder;
35-
use Doctrine\DBAL\Query\QueryBuilder;
3635

3736

3837
/**
@@ -83,26 +82,5 @@ public function limitToInstance(string $instance): void {
8382
public function limitToParent(string $parent): void {
8483
$this->limit('parent', $parent);
8584
}
86-
87-
88-
/**
89-
*
90-
*/
91-
public function countIncremental(): void {
92-
if ($this->getType() !== QueryBuilder::SELECT) {
93-
return;
94-
}
95-
96-
$expr = $this->expr();
97-
$incremental = 'incremental';
98-
$this->selectAlias(
99-
$this->createFunction('COUNT(`' . $incremental . '`.`id`)'),
100-
'count_incremental'
101-
);
102-
$this->leftJoin(
103-
$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_RESTORING_POINT, $incremental,
104-
$expr->eq($this->getDefaultSelectAlias() . '.uid', $incremental . '.parent')
105-
);
106-
}
107-
85+
10886
}

lib/Db/PointRequest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ public function getLocalById(string $pointId): RestoringPoint {
128128
$qb->limitToUid($pointId);
129129
$qb->limitToInstance('');
130130

131-
$qb->countIncremental();
132-
133131
return $this->getItemFromRequest($qb);
134132
}
135133

@@ -147,7 +145,6 @@ public function getById(string $pointId, string $instance = ''): RestoringPoint
147145
if ($instance !== '') {
148146
$qb->limitToInstance($instance);
149147
}
150-
$qb->countIncremental();
151148

152149
return $this->getItemFromRequest($qb);
153150
}
@@ -161,7 +158,6 @@ public function getById(string $pointId, string $instance = ''): RestoringPoint
161158
public function getByInstance(string $instance): array {
162159
$qb = $this->getPointSelectSql();
163160
$qb->limitToInstance($instance);
164-
$qb->countIncremental();
165161

166162
return $this->getItemsFromRequest($qb);
167163
}

lib/Model/RestoringPoint.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ class RestoringPoint implements IDeserializable, INC23QueryRow, ISignedModel, Js
9191
/** @var bool */
9292
private $package = false;
9393

94-
/** @var int */
95-
private $countIncremental = 0;
9694

9795
/**
9896
* @param string $id
@@ -383,25 +381,6 @@ public function getMetadata(): array {
383381
}
384382

385383

386-
/**
387-
* @param int $count
388-
*
389-
* @return RestoringPoint
390-
*/
391-
public function setCountIncremental(int $count): self {
392-
$this->countIncremental = $count;
393-
394-
return $this;
395-
}
396-
397-
/**
398-
* @return int
399-
*/
400-
public function getCountIncremental(): int {
401-
return $this->countIncremental;
402-
}
403-
404-
405384
/**
406385
* @param array $data
407386
*
@@ -413,8 +392,7 @@ public function importFromDatabase(array $data): INC23QueryRow {
413392
->setInstance($this->get('instance', $data))
414393
->setParent($this->get('parent', $data))
415394
->setStatus($this->getInt('status', $data))
416-
->setDate($this->getInt('date', $data))
417-
->setCountIncremental($this->getInt('count_incremental', $data));
395+
->setDate($this->getInt('date', $data));
418396

419397
if ($this->getId() === '') {
420398
throw new InvalidItemException();

0 commit comments

Comments
 (0)