mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 18:42:00 -04:00
Set ebook placeholders to not be in progress when a project is marked as abandoned
This commit is contained in:
parent
97021ce26d
commit
28b7384769
2 changed files with 32 additions and 0 deletions
|
@ -65,6 +65,17 @@ foreach($projects as $project){
|
|||
// A stalled `Project` is now abandoned.
|
||||
$project->Status = Enums\ProjectStatusType::Abandoned;
|
||||
|
||||
// Set the corresponding `EbookPlaceholder` to not be "in progress" any more.
|
||||
if($project->Ebook->EbookPlaceholder !== null){
|
||||
try{
|
||||
$project->Ebook->EbookPlaceholder->IsInProgress = false;
|
||||
$project->Ebook->EbookPlaceholder->Save();
|
||||
}
|
||||
catch(Exceptions\InvalidEbookPlaceholderException){
|
||||
// Pass.
|
||||
}
|
||||
}
|
||||
|
||||
// Send a notification to the producer.
|
||||
$project->SendReminder(Enums\ProjectReminderType::Abandoned);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue