1 | <?php |
||
14 | class DBToFile extends Command |
||
15 | { |
||
16 | /** |
||
17 | * @var DataBaseFunctions |
||
18 | */ |
||
19 | protected $db_functions; |
||
20 | /** |
||
21 | * The name and signature of the console command. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $signature = 'file_creator:create'; |
||
26 | |||
27 | /** |
||
28 | * The console command description. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $description = 'Create files from DB and transform him'; |
||
33 | |||
34 | /** |
||
35 | * Create a new command instance. |
||
36 | * @param DataBaseFunctions $db_functions |
||
37 | */ |
||
38 | public function __construct(DataBaseFunctions $db_functions) |
||
45 | |||
46 | /** |
||
47 | * Execute the console command. |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | public function handle() |
||
65 | |||
66 | /** |
||
67 | * @param $company_history |
||
68 | */ |
||
69 | public function transformData($company_history) |
||
90 | |||
91 | /** |
||
92 | * @param $to_store |
||
93 | * @param $extension_file |
||
94 | * @param $name_file |
||
95 | */ |
||
96 | public function createAndStore($to_store, $extension_file, $name_file) |
||
103 | |||
104 | } |
||
105 |
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: