diff --git a/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariable.php b/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariable.php index 4417e912b1..7b92da9961 100644 --- a/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariable.php +++ b/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariable.php @@ -30,7 +30,7 @@ protected function initializeIterator() { /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return count($this->getCommentVariables()); } diff --git a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php index a54b17d9d1..452c6bbfde 100644 --- a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php +++ b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php @@ -145,7 +145,7 @@ public function getIds() { /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return $this->initializeIterator()->count(); } diff --git a/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php b/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php index 17c34bf3ab..f4182a927e 100644 --- a/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php +++ b/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php @@ -78,7 +78,7 @@ public function fields() { /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return count($this->initializeIterator()); } diff --git a/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php b/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php index b77f95e273..efe56b41fa 100644 --- a/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php +++ b/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php @@ -27,7 +27,7 @@ public function query() { /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return 1; } diff --git a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php index 429a1457a8..e34c4adfde 100644 --- a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php +++ b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php @@ -436,7 +436,10 @@ public function getCurrentIds() { * Returns -1 if the source is not countable. * * @param bool $refresh - * (optional) Whether or not to refresh the count. Defaults to FALSE. + * (optional) Whether or not to refresh the count. Defaults to FALSE. Not + * all implementations support caching the counts. In such instance this + * parameter is meaningless the result of calling the method will always be + * up to date. * * @return int * The count. diff --git a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php index 881e2fbcf6..35ab8abd85 100644 --- a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php +++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php @@ -365,7 +365,7 @@ protected function fetchNextBatch() { /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return $this->query()->countQuery()->execute()->fetchField(); } diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php index 410acec229..e127dfbdc8 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php @@ -58,7 +58,7 @@ protected function values() { /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return intval($this->query()->countQuery()->execute()->fetchField() > 0); } diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/VariableTranslation.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/VariableTranslation.php index 566a8402e0..f2ca8b73aa 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/VariableTranslation.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/VariableTranslation.php @@ -68,7 +68,7 @@ protected function values() { /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return $this->initializeIterator()->count(); } diff --git a/core/modules/node/src/Plugin/migrate/source/d6/ViewModeBase.php b/core/modules/node/src/Plugin/migrate/source/d6/ViewModeBase.php index 315f069a61..88d84d9524 100644 --- a/core/modules/node/src/Plugin/migrate/source/d6/ViewModeBase.php +++ b/core/modules/node/src/Plugin/migrate/source/d6/ViewModeBase.php @@ -12,7 +12,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return count($this->initializeIterator()); }