1 | <?php |
||
9 | trait CommandTrait |
||
10 | { |
||
11 | /** |
||
12 | * Model name. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $model; |
||
17 | |||
18 | /** |
||
19 | * Table name. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $table; |
||
24 | |||
25 | /** |
||
26 | * Base path. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $path; |
||
31 | |||
32 | /** |
||
33 | * Get model. |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | 8 | protected function getModel() |
|
41 | |||
42 | /** |
||
43 | * Set model. |
||
44 | * |
||
45 | * @param string $model |
||
46 | * |
||
47 | * @return $this |
||
48 | */ |
||
49 | 8 | protected function setModel($model) |
|
57 | |||
58 | /** |
||
59 | * Get table. |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 6 | protected function getTable() |
|
67 | |||
68 | /** |
||
69 | * Set table. |
||
70 | * |
||
71 | * @param string $table |
||
72 | * |
||
73 | * @return $this |
||
74 | */ |
||
75 | 6 | protected function setTable($table) |
|
83 | |||
84 | /** |
||
85 | * Get path. |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | 12 | protected function getPath() |
|
93 | |||
94 | /** |
||
95 | * Set path. |
||
96 | * |
||
97 | * @param string $path |
||
98 | * |
||
99 | * @return $this |
||
100 | */ |
||
101 | 8 | protected function setPath($path) |
|
109 | |||
110 | /** |
||
111 | * Create directory. |
||
112 | * |
||
113 | * @param string $directory |
||
114 | */ |
||
115 | 4 | protected function createDirectory($directory) |
|
121 | |||
122 | /** |
||
123 | * Get content from stub and update. |
||
124 | * |
||
125 | * @param string $type |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | 6 | protected function getContent($type) |
|
150 | |||
151 | /** |
||
152 | * Write the file to the filesystem. |
||
153 | * |
||
154 | * @param string $content |
||
155 | * @param string $directory |
||
156 | * @param string $fileName |
||
157 | * @param null $end |
||
158 | * @param null $ext |
||
159 | */ |
||
160 | 4 | protected function writeFile($content, $directory, $fileName, $end = null, $ext = null) |
|
176 | } |
||
177 |