1 | <?php |
||
10 | class FileDateMigrationCreator extends Creator implements MigrationCreator |
||
11 | { |
||
12 | /** |
||
13 | * Create a migration file. |
||
14 | * |
||
15 | * @param string $name |
||
16 | * @param string $create |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | public function create($name, $create = false) |
||
40 | |||
41 | /** |
||
42 | * Return StudlyCase class name. |
||
43 | * |
||
44 | * @param string $name |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | protected function getClassName($name) |
||
52 | |||
53 | /** |
||
54 | * If class name already exists, throw exception. Prone to failure due to |
||
55 | * autoloading strategy. |
||
56 | * |
||
57 | * @param string $className |
||
58 | * |
||
59 | * @throws WriteError |
||
60 | */ |
||
61 | protected function failIfClassExists($className) |
||
67 | |||
68 | /** |
||
69 | * Get stub with appropriate class name/table name. |
||
70 | * |
||
71 | * @param string $className |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | protected function getStub($className, $create) |
||
83 | |||
84 | /** |
||
85 | * Populate stub with class name and table name. |
||
86 | * |
||
87 | * @param string $stub |
||
88 | * @param string $className |
||
89 | * @param string $create |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | protected function populateStub($stub, $className, $create) |
||
101 | |||
102 | /** |
||
103 | * Get the full path to save file to. |
||
104 | * |
||
105 | * @param string $name |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | protected function getSavePath($name) |
||
115 | |||
116 | /** |
||
117 | * Build file name for migration. |
||
118 | * |
||
119 | * @param string $name |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | protected function buildFileName($name) |
||
127 | |||
128 | /** |
||
129 | * Get the date prefix for the migration. |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | protected function getDatePrefix() |
||
137 | } |
||
138 |