1 | <?php |
||
7 | class TranslateTableCommand extends BaseCommand |
||
8 | { |
||
9 | /** |
||
10 | * The console command signature. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $signature = 'make:translate {name : The name of the translate table.} |
||
15 | {--path= : The location where the migration file should be created.}'; |
||
16 | /** |
||
17 | * The console command description. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $description = 'Create a new translate migration file'; |
||
22 | /** |
||
23 | * The migration creator instance. |
||
24 | * |
||
25 | * @var \Illuminate\Database\Migrations\MigrationCreator |
||
26 | */ |
||
27 | protected $creator; |
||
28 | /** |
||
29 | * The Composer instance. |
||
30 | * |
||
31 | * @var \Illuminate\Support\Composer |
||
32 | */ |
||
33 | protected $composer; |
||
34 | /** |
||
35 | * Create a new migration install command instance. |
||
36 | * |
||
37 | * @param \Dimsav\Translatable\Console\MigrationCreator $creator |
||
38 | * @param \Illuminate\Support\Composer $composer |
||
39 | * @return void |
||
|
|||
40 | */ |
||
41 | public function __construct(MigrationCreator $creator, Composer $composer) |
||
47 | /** |
||
48 | * Execute the console command. |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | public function fire() |
||
70 | /** |
||
71 | * Get the translate table name. |
||
72 | * |
||
73 | * @param string $table |
||
74 | * @return string |
||
75 | */ |
||
76 | protected function getTableName($table) |
||
81 | /** |
||
82 | * Get the translate model class name. |
||
83 | * |
||
84 | * @param $table |
||
85 | * @return string |
||
86 | */ |
||
87 | protected function getModelName($table) |
||
98 | /** |
||
99 | * Get the translate migration file name. |
||
100 | * |
||
101 | * @param string $name |
||
102 | * @return string |
||
103 | */ |
||
104 | protected function getMigrationName($name) |
||
108 | /** |
||
109 | * Write the migration file to disk. |
||
110 | * |
||
111 | * @param string $name |
||
112 | * @param string $table |
||
113 | * @param bool $create |
||
114 | * @return string |
||
115 | */ |
||
116 | protected function writeMigration($name, $table, $create) |
||
121 | /** |
||
122 | * Get migration path (either specified by '--path' option or default location). |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | protected function getMigrationPath() |
||
133 | } |
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.