szurubooru/src/Api/Jobs/EditPostJob.php

38 lines
606 B
PHP
Raw Normal View History

2014-05-03 18:09:31 +02:00
<?php
2014-05-03 22:18:41 +02:00
class EditPostJob extends AbstractPostJob
2014-05-03 18:09:31 +02:00
{
public function execute()
{
$post = $this->post;
2014-05-04 13:39:00 +02:00
LogHelper::bufferChanges();
2014-05-03 18:09:31 +02:00
$subJobs =
[
new EditPostSafetyJob(),
new EditPostTagsJob(),
new EditPostSourceJob(),
new EditPostRelationsJob(),
new EditPostContentJob(),
new EditPostUrlJob(),
new EditPostThumbJob(),
];
foreach ($subJobs as $subJob)
{
$args = $this->getArguments();
$args[self::POST_ID] = $post->id;
try
{
Api::run($subJob, $args);
}
catch (ApiMissingArgumentException $e)
{
}
}
2014-05-04 13:39:00 +02:00
LogHelper::flush();
2014-05-03 18:09:31 +02:00
return $post;
}
}