public function CliService::reset_status_entities in CMS Content Sync 2.1.x
Same name and namespace in other branches
- 8 src/Cli/CliService.php \Drupal\cms_content_sync\Cli\CliService::reset_status_entities()
- 2.0.x src/Cli/CliService.php \Drupal\cms_content_sync\Cli\CliService::reset_status_entities()
Reset the status entities for a specific or all pool/s.
Parameters
ICLIIO $io: The CLI service which allows interoperability
array $options: An array containing the option parameters provided by Drush
Throws
\Drush\Exceptions\UserAbortException
File
- src/
Cli/ CliService.php, line 426
Class
Namespace
Drupal\cms_content_sync\CliCode
public function reset_status_entities($io, $options = [
'pool_id' => null,
]) {
$pool_id = empty($options['pool_id']) ? null : $options['pool_id'];
if (empty($pool_id)) {
$io
->warning(dt('Are you sure you want to reset the status entities for all pools?'));
}
else {
$io
->warning(dt('Are you sure you want to reset the status entities for the pool: ' . $pool_id . '?'));
}
$io
->warning(dt('By resetting the status of all entities, the date of the last pull and the date of the last push date will be reset. The dates will no longer be displayed until the content is pulled or pushed again and all entities will be pushed / pulled again at the next synchronization regardless of whether they have changed or not.'));
if (!$io
->confirm(dt('Do you want to continue?'))) {
throw new UserAbortException();
}
empty($pool_id) ? Pool::resetStatusEntities() : Pool::resetStatusEntities($pool_id);
$io
->success('Status entities have been reset and entity caches are invalidated.');
}