private function timedHandleRecords($contentTypeName, $type)
{
try {
/** @var ContentRepository $contentRepo */
$contentRepo = $this->em->getRepository($contentTypeName);
} catch (InvalidRepositoryException $e) {
// ContentType doesn't have a repository
return;
}
$types = ['timed' => ['target' => 'published', 'legacy' => 'publish'], 'hold' => ['target' => 'held', 'legacy' => 'depublish']];
try {
$records = $this->getTimedRecords($contentRepo, $type);
} catch (TableNotFoundException $e) {
return;
}
/** @var Content $content */
foreach ($records as $content) {
$content->set('status', $types[$type]['target']);
$this->save($contentRepo, $content, $type, $types[$type]['legacy']);
}
}