Revisão ab2f5151 app/Console/Commands/Sogo/Preferences.php
app/Console/Commands/Sogo/Preferences.php | ||
---|---|---|
13 | 13 |
* |
14 | 14 |
* @var string |
15 | 15 |
*/ |
16 |
protected $signature = 'sogo:preferences-get {--u|user=} {cmd?}';
|
|
16 |
protected $signature = 'sogo:get-user-preferences {--u|user=}';
|
|
17 | 17 |
|
18 | 18 |
/** |
19 | 19 |
* The console command description. |
20 | 20 |
* |
21 | 21 |
* @var string |
22 | 22 |
*/ |
23 |
protected $description = 'Lista as preferencias sogo do usuario';
|
|
23 |
protected $description = 'lista preferências sogo do usuário';
|
|
24 | 24 |
|
25 | 25 |
/** |
26 | 26 |
* Create a new command instance. |
... | ... | |
43 | 43 |
|
44 | 44 |
$user = $this->option('user') ?? null; |
45 | 45 |
|
46 |
if( isset($arguments['cmd']) && $arguments['cmd'] == 'help' ) |
|
47 |
{ |
|
48 |
$this->help(); |
|
49 |
|
|
50 |
} else { |
|
46 |
if( !is_null($user) ){ |
|
51 | 47 |
|
52 |
if( !is_null($user) ){
|
|
48 |
$preferences = $this->getPreferences($user);
|
|
53 | 49 |
|
54 |
$preferences = $this->getPreferences($user); |
|
55 |
|
|
56 |
print_r( json_decode($preferences->c_defaults) ); |
|
57 |
} |
|
50 |
print_r( json_decode($preferences->c_defaults) ); |
|
58 | 51 |
} |
59 | 52 |
|
60 | 53 |
$this->newLine(); |
... | ... | |
69 | 62 |
|
70 | 63 |
return $preferences; |
71 | 64 |
} |
72 |
|
|
73 |
private function help() |
|
74 |
{ |
|
75 |
$this->newLine(); |
|
76 |
$this->info('EXEMPLO DE UTILIZACAO : '); |
|
77 |
$this->info('Ex: php artisan sogo:preferences-get --user=<usuario> { print | file }'); |
|
78 |
$this->newLine(); |
|
79 |
} |
|
80 | 65 |
} |
Exportar para Unified diff