1 | <?php |
||
13 | class DBToFile extends Command |
||
14 | { |
||
15 | /** |
||
16 | * The name and signature of the console command. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $signature = 'file_creator:create'; |
||
21 | |||
22 | /** |
||
23 | * The console command description. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $description = 'Create files from DB and transform him'; |
||
28 | |||
29 | /** |
||
30 | * Create a new command instance. |
||
31 | * |
||
32 | */ |
||
33 | public function __construct() |
||
37 | |||
38 | /** |
||
39 | * Execute the console command. |
||
40 | * |
||
41 | * @return mixed |
||
42 | */ |
||
43 | public function handle() |
||
55 | |||
56 | /** |
||
57 | * @param $company_history |
||
58 | */ |
||
59 | public function transformData($company_history) |
||
80 | |||
81 | /** |
||
82 | * @param $to_store |
||
83 | * @param $extension_file |
||
84 | * @param $name_file |
||
85 | */ |
||
86 | public function createAndStore($to_store, $extension_file, $name_file) |
||
93 | |||
94 | /** |
||
95 | * @return array|static[] |
||
96 | */ |
||
97 | public function getDataFromBD() |
||
103 | |||
104 | |||
105 | |||
106 | } |
||
107 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: