1 | <?php |
||
11 | abstract class AbstractExportCommand extends Command |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * The name and signature of the console command. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $signature = ''; |
||
20 | |||
21 | /** |
||
22 | * The console command description. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $description = ''; |
||
27 | |||
28 | /** |
||
29 | * The export folder location. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $exportFolder = ''; |
||
34 | |||
35 | /** |
||
36 | * The export file name. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $exportFileName = ''; |
||
41 | |||
42 | |||
43 | /** |
||
44 | * The export extension file. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $exportFileExt = '.txt'; |
||
49 | |||
50 | /** |
||
51 | * The export storage disk name. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $storageDisk = 'export'; |
||
56 | |||
57 | /** |
||
58 | * The export storage location. |
||
59 | * |
||
60 | * @var Illuminate\Contracts\Filesystem\Filesystem |
||
61 | */ |
||
62 | protected $storage; |
||
63 | |||
64 | /** |
||
65 | * Create a new command instance. |
||
66 | * |
||
67 | * @return void |
||
|
|||
68 | */ |
||
69 | public function __construct() |
||
74 | |||
75 | /** |
||
76 | * Execute the console command. |
||
77 | * |
||
78 | * @return mixed |
||
79 | */ |
||
80 | abstract public function handle(); |
||
81 | |||
82 | |||
83 | /** |
||
84 | * Export filtered accounts into target file. |
||
85 | * |
||
86 | * @param App\Account $accounts |
||
87 | * @param string $filename |
||
88 | * @param bool $password |
||
89 | * @param bool $flagCI |
||
90 | * |
||
91 | * @return int |
||
92 | */ |
||
93 | final protected function exportAccounts($accounts, $filename, $password = false, $flagCI = false) |
||
119 | |||
120 | /** |
||
121 | * Retrieve enabled accounts. |
||
122 | * |
||
123 | * @param array $filter |
||
124 | * |
||
125 | * @return App\Account |
||
126 | */ |
||
127 | final protected function fecthAccounts($filter=null) |
||
137 | |||
138 | final protected function exportToLocation($filename) |
||
167 | } |
||
168 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.