@@ 942-952 (lines=11) @@ | ||
939 | * |
|
940 | * @return int |
|
941 | */ |
|
942 | protected function getTotalBackupCount($table) |
|
943 | { |
|
944 | $platform = $this->connection->getDatabasePlatform(); |
|
945 | ||
946 | $queryBuilder = $this->connection->createQueryBuilder(); |
|
947 | $queryBuilder |
|
948 | ->select($platform->getCountExpression('id')) |
|
949 | ->from($table); |
|
950 | ||
951 | return (int)$queryBuilder->execute()->fetchColumn(); |
|
952 | } |
|
953 | ||
954 | /** |
|
955 | * Creates database table for custom Location URL alias backup. |
|
@@ 1021-1031 (lines=11) @@ | ||
1018 | * |
|
1019 | * @return bool |
|
1020 | */ |
|
1021 | protected function isTableEmpty($name) |
|
1022 | { |
|
1023 | $queryBuilder = $this->connection->createQueryBuilder(); |
|
1024 | $queryBuilder |
|
1025 | ->select($this->connection->getDatabasePlatform()->getCountExpression('*')) |
|
1026 | ->from($name); |
|
1027 | ||
1028 | $count = $queryBuilder->execute()->fetchColumn(); |
|
1029 | ||
1030 | return $count == 0; |
|
1031 | } |
|
1032 | ||
1033 | /** |
|
1034 | * Returns configured progress bar helper. |
@@ 1395-1403 (lines=9) @@ | ||
1392 | return $rows; |
|
1393 | } |
|
1394 | ||
1395 | public function countTrashed(): int |
|
1396 | { |
|
1397 | $dbPlatform = $this->connection->getDatabasePlatform(); |
|
1398 | $query = $this->connection->createQueryBuilder() |
|
1399 | ->select($dbPlatform->getCountExpression('node_id')) |
|
1400 | ->from('ezcontentobject_trash'); |
|
1401 | ||
1402 | return $query->execute()->fetchColumn(); |
|
1403 | } |
|
1404 | ||
1405 | /** |
|
1406 | * Removes every entries in the trash. |