1 | <?php |
||
15 | class DataTablesMakeCommand extends GeneratorCommand |
||
16 | { |
||
17 | /** |
||
18 | * The console command name. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $name = 'datatables:make'; |
||
23 | |||
24 | /** |
||
25 | * The console command description. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $description = 'Create a new DataTable service class.'; |
||
30 | |||
31 | /** |
||
32 | * The type of class being generated. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $type = 'DataTable'; |
||
37 | |||
38 | /** |
||
39 | * The model class to be used by dataTable. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $model; |
||
44 | |||
45 | /** |
||
46 | * DataTable export filename. |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $filename; |
||
51 | |||
52 | /** |
||
53 | * Build the class with the given name. |
||
54 | * |
||
55 | * @param string $name |
||
56 | * @return string |
||
57 | */ |
||
58 | protected function buildClass($name) |
||
66 | |||
67 | /** |
||
68 | * Replace model name. |
||
69 | * |
||
70 | * @param string $stub |
||
71 | * @return mixed |
||
72 | */ |
||
73 | protected function replaceModel(&$stub) |
||
81 | |||
82 | /** |
||
83 | * Get model name to use. |
||
84 | */ |
||
85 | protected function getModel() |
||
95 | |||
96 | /** |
||
97 | * Replace model import. |
||
98 | * |
||
99 | * @param string $stub |
||
100 | * @return $this |
||
101 | */ |
||
102 | protected function replaceModelImport(&$stub) |
||
110 | |||
111 | /** |
||
112 | * Get the stub file for the generator. |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | protected function getStub() |
||
120 | |||
121 | /** |
||
122 | * Replace the filename. |
||
123 | * |
||
124 | * @param string $stub |
||
125 | * @return string |
||
126 | */ |
||
127 | protected function replaceFilename(&$stub) |
||
135 | |||
136 | /** |
||
137 | * Get the console command options. |
||
138 | * |
||
139 | * @return array |
||
140 | */ |
||
141 | protected function getOptions() |
||
147 | |||
148 | /** |
||
149 | * Parse the name and format according to the root namespace. |
||
150 | * |
||
151 | * @param string $name |
||
152 | * @return string |
||
153 | */ |
||
154 | protected function qualifyClass($name) |
||
172 | |||
173 | /** |
||
174 | * Get the default namespace for the class. |
||
175 | * |
||
176 | * @param string $rootNamespace |
||
177 | * @return string |
||
178 | */ |
||
179 | protected function getDefaultNamespace($rootNamespace) |
||
183 | } |
||
184 |