Skip to content

Commit b7978f4

Browse files
committed
IBX-10458: Remove countContentTypes
1 parent 8282ee4 commit b7978f4

File tree

12 files changed

+0
-202
lines changed

12 files changed

+0
-202
lines changed

src/contracts/Persistence/Content/Type/Handler.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ public function loadContentTypes($groupId, $status = Type::STATUS_DEFINED);
9292
*/
9393
public function loadContentTypeList(array $contentTypeIds): array;
9494

95-
public function countContentTypes(?ContentTypeQuery $query = null): int;
96-
9795
/**
9896
* @return array{count: int, items: array<string, mixed>}
9997
*/

src/contracts/Repository/ContentTypeService.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ public function loadContentTypeList(array $contentTypeIds, array $prioritizedLan
180180
*/
181181
public function findContentTypes(?ContentTypeQuery $query = null, array $prioritizedLanguages = []): SearchResult;
182182

183-
public function countContentTypes(?ContentTypeQuery $query = null): int;
184-
185183
/**
186184
* Get content type objects which belong to the given content type group.
187185
*

src/contracts/Repository/Decorator/ContentTypeServiceDecorator.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ public function findContentTypes(?ContentTypeQuery $query = null, array $priorit
114114
return $this->innerService->findContentTypes($query, $prioritizedLanguages);
115115
}
116116

117-
public function countContentTypes(?ContentTypeQuery $query = null): int
118-
{
119-
return $this->innerService->countContentTypes($query);
120-
}
121-
122117
public function loadContentTypes(
123118
ContentTypeGroup $contentTypeGroup,
124119
array $prioritizedLanguages = []

src/lib/Persistence/Cache/ContentTypeHandler.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,6 @@ function () use ($groupId) {
233233
);
234234
}
235235

236-
public function countContentTypes(?ContentTypeQuery $query = null): int
237-
{
238-
$this->logger->logCall(__METHOD__, [
239-
'query' => $query,
240-
]);
241-
242-
return $this->persistenceHandler->contentTypeHandler()->countContentTypes($query);
243-
}
244-
245236
public function findContentTypes(?ContentTypeQuery $query = null): array
246237
{
247238
$this->logger->logCall(__METHOD__, [

src/lib/Persistence/Legacy/Content/Type/Gateway.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ abstract public function removeFieldDefinitionTranslation(
173173
*/
174174
abstract public function removeByUserAndVersion(int $userId, int $version): void;
175175

176-
abstract public function countContentTypes(?ContentTypeQuery $query = null): int;
177-
178176
/**
179177
* @return array<int,array<string,mixed>>
180178
*/

src/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,20 +1417,6 @@ public function removeByUserAndVersion(int $userId, int $version): void
14171417
}
14181418
}
14191419

1420-
public function countContentTypes(?ContentTypeQuery $query = null): int
1421-
{
1422-
$queryBuilder = $this->connection->createQueryBuilder();
1423-
$queryBuilder
1424-
->select('COUNT(c.id)')
1425-
->from(self::CONTENT_TYPE_TABLE, 'c');
1426-
1427-
if ($query !== null && !empty($query->getCriterion())) {
1428-
$queryBuilder->andWhere($this->criterionVisitor->visitCriteria($queryBuilder, $query->getCriterion()));
1429-
}
1430-
1431-
return (int)$queryBuilder->execute()->fetchOne();
1432-
}
1433-
14341420
public function findContentTypes(?ContentTypeQuery $query = null): array
14351421
{
14361422
$queryBuilder = $this->getLoadTypeQueryBuilder();

src/lib/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,6 @@ public function removeByUserAndVersion(int $userId, int $version): void
343343
}
344344
}
345345

346-
public function countContentTypes(?ContentTypeQuery $query = null): int
347-
{
348-
try {
349-
return $this->innerGateway->countContentTypes($query);
350-
} catch (DBALException | PDOException $e) {
351-
throw DatabaseException::wrap($e);
352-
}
353-
}
354-
355346
public function findContentTypes(?ContentTypeQuery $query = null): array
356347
{
357348
try {

src/lib/Persistence/Legacy/Content/Type/Handler.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@ public function loadContentTypeList(array $contentTypeIds): array
196196
);
197197
}
198198

199-
public function countContentTypes(?ContentTypeQuery $query = null): int
200-
{
201-
return $this->contentTypeGateway->countContentTypes($query);
202-
}
203-
204199
public function findContentTypes(?ContentTypeQuery $query = null): array
205200
{
206201
$rows = $this->contentTypeGateway->findContentTypes($query);

src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,6 @@ public function loadContentTypes($groupId, $status = Type::STATUS_DEFINED): arra
172172
return $types;
173173
}
174174

175-
public function countContentTypes(?ContentTypeQuery $query = null): int
176-
{
177-
return $this->innerHandler->countContentTypes($query);
178-
}
179-
180175
public function findContentTypes(?ContentTypeQuery $query = null): array
181176
{
182177
return $this->innerHandler->findContentTypes($query);

src/lib/Repository/ContentTypeService.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -952,11 +952,6 @@ public function findContentTypes(?ContentTypeQuery $query = null, array $priorit
952952
]);
953953
}
954954

955-
public function countContentTypes(?ContentTypeQuery $query = null): int
956-
{
957-
return $this->contentTypeHandler->countContentTypes($query);
958-
}
959-
960955
/**
961956
* {@inheritdoc}
962957
*/

0 commit comments

Comments
 (0)