1 | <?php |
||
11 | class Migration |
||
12 | { |
||
13 | /** |
||
14 | * @param SchemaTable $schemaTable description |
||
15 | * @param MigrationFiles $migrationFiles description |
||
16 | * @param Manipulation $schemaManipulation description |
||
17 | * @param Info $schemaInfo description |
||
18 | */ |
||
19 | public function __construct(SchemaTable $schemaTable, MigrationFiles $migrationFiles, Manipulation $schemaManipulation, Info $schemaInfo) |
||
26 | |||
27 | /** |
||
28 | * Migrate the schema to the given version. |
||
29 | * |
||
30 | * @return integer Number of migrations. |
||
31 | */ |
||
32 | public function migrate($version = null, $message = null) |
||
36 | |||
37 | /** |
||
38 | * Migrate the schema to previous version. |
||
39 | * |
||
40 | * @return integer Number of migrations. |
||
41 | */ |
||
42 | public function migrateToPreviousVersion($message) |
||
46 | |||
47 | /** |
||
48 | * Create an instance of migration class. |
||
49 | * |
||
50 | * @param $className Name of migration class. |
||
51 | * |
||
52 | * @return mixed |
||
53 | */ |
||
54 | protected function createMigrationApiInstance($className) |
||
58 | |||
59 | /** |
||
60 | * Execute migrate. |
||
61 | * |
||
62 | * @param string $version The version of migration to rollback or migrate. |
||
63 | * |
||
64 | * @return integer Number of executed migrations. |
||
65 | */ |
||
66 | private function execute($version = null, $message = null) |
||
108 | } |
||
109 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: