1 | <?php |
||
10 | class TranslateTableCommand extends BaseCommand |
||
11 | { |
||
12 | /** |
||
13 | * The console command signature. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $signature = 'make:translate {name : The name of the translate table.} |
||
18 | {--path= : The location where the migration file should be created.}'; |
||
19 | |||
20 | /** |
||
21 | * The console command description. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $description = 'Create a new translate migration file'; |
||
26 | |||
27 | /** |
||
28 | * The migration creator instance. |
||
29 | * |
||
30 | * @var \Illuminate\Database\Migrations\MigrationCreator |
||
31 | */ |
||
32 | protected $creator; |
||
33 | |||
34 | /** |
||
35 | * The Composer instance. |
||
36 | * |
||
37 | * @var \Illuminate\Support\Composer |
||
38 | */ |
||
39 | protected $composer; |
||
40 | |||
41 | /** |
||
42 | * Create a new migration install command instance. |
||
43 | * |
||
44 | * @param \Dimsav\Translatable\Console\MigrationCreator $creator |
||
45 | * @param \Illuminate\Support\Composer $composer |
||
46 | * @return void |
||
|
|||
47 | */ |
||
48 | public function __construct(MigrationCreator $creator, Composer $composer) |
||
55 | |||
56 | /** |
||
57 | * Execute the console command. |
||
58 | * |
||
59 | * @return void |
||
60 | */ |
||
61 | public function fire() |
||
83 | |||
84 | /** |
||
85 | * Get the translate table name. |
||
86 | * |
||
87 | * @param string $table |
||
88 | * @return string |
||
89 | */ |
||
90 | protected function getTableName($table) |
||
96 | |||
97 | /** |
||
98 | * Get the translate model class name. |
||
99 | * |
||
100 | * @param $table |
||
101 | * @return string |
||
102 | */ |
||
103 | protected function getModelName($table) |
||
117 | |||
118 | /** |
||
119 | * Get the translate migration file name. |
||
120 | * |
||
121 | * @param string $name |
||
122 | * @return string |
||
123 | */ |
||
124 | protected function getMigrationName($name) |
||
128 | |||
129 | /** |
||
130 | * Write the migration file to disk. |
||
131 | * |
||
132 | * @param string $name |
||
133 | * @param string $table |
||
134 | * @param bool $create |
||
135 | * @return string |
||
136 | */ |
||
137 | protected function writeMigration($name, $table, $create) |
||
143 | |||
144 | /** |
||
145 | * Get migration path (either specified by '--path' option or default location). |
||
146 | * |
||
147 | * @return string |
||
148 | */ |
||
149 | protected function getMigrationPath() |
||
157 | } |
||
158 |
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.