Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Job/SharedFolderUpdate.php
- This file was copied from src/app/Console/Commands/Job/UserUpdate.php.
<?php | <?php | ||||
namespace App\Console\Commands\Job; | namespace App\Console\Commands\Job; | ||||
use App\Console\Command; | use App\Console\Command; | ||||
use App\User; | |||||
class UserUpdate extends Command | class SharedFolderUpdate extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'job:userupdate {user}'; | protected $signature = 'job:sharedfolderupdate {folder}'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = "Execute the UserUpdate job (again)."; | protected $description = "Execute the shared folder update job (again)."; | ||||
/** | /** | ||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$user = $this->getUser($this->argument('user')); | $folder = $this->getSharedFolder($this->argument('folder')); | ||||
if (!$user) { | if (!$folder) { | ||||
return 1; | return 1; | ||||
} | } | ||||
$job = new \App\Jobs\User\UpdateJob($user->id); | $job = new \App\Jobs\SharedFolder\UpdateJob($folder->id); | ||||
$job->handle(); | $job->handle(); | ||||
} | } | ||||
} | } |