Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Merge af767ec into de9b37d
Browse files Browse the repository at this point in the history
  • Loading branch information
Jalle19 committed Mar 1, 2018
2 parents de9b37d + af767ec commit 87a571a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
8 changes: 7 additions & 1 deletion src/Console/Commands/AbstractSyncCommand.php
Expand Up @@ -58,7 +58,13 @@ abstract protected function getQuery(?string $contentType = null): Query;
*
* @return Query the query used to get the total number of items
*/
abstract protected function getTotalQuery(?string $contentType = null): Query;
protected function getTotalQuery(?string $contentType = null): Query
{
$query = clone $this->getQuery($contentType);

return $query->setSkip(0)
->setLimit(1);
}

/**
* AbstractSyncCommand constructor.
Expand Down
11 changes: 0 additions & 11 deletions src/Console/Commands/SyncAssetsCommand.php
Expand Up @@ -36,17 +36,6 @@ protected function getQuery(?string $contentType = null): Query
return $query;
}

/**
* @inheritdoc
*/
protected function getTotalQuery(?string $contentType = null): Query
{
$query = new Query();
$query->setLimit(1);

return $query;
}

/**
* @inheritdoc
*/
Expand Down
12 changes: 0 additions & 12 deletions src/Console/Commands/SyncContentsCommand.php
Expand Up @@ -42,18 +42,6 @@ protected function getQuery(?string $contentType = null): Query
return $query;
}

/**
* @inheritdoc
*/
protected function getTotalQuery(?string $contentType = null): Query
{
$query = new Query();
$query->setLimit(1);
$query->setContentType($contentType);

return $query;
}

/**
* @inheritdoc
*/
Expand Down

0 comments on commit 87a571a

Please sign in to comment.