| 1 | <?php |
||
| 5 | class MigrationState |
||
| 6 | { |
||
| 7 | /** @var Migration */ |
||
| 8 | protected $migration; |
||
| 9 | |||
| 10 | /** @var string */ |
||
| 11 | protected $bundleName; |
||
| 12 | |||
| 13 | /** @var string */ |
||
| 14 | protected $version; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var bool|null |
||
| 18 | * null - not executed |
||
| 19 | * true - success |
||
| 20 | * false = failure |
||
| 21 | */ |
||
| 22 | protected $state; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param Migration $migration |
||
| 26 | * @param string|null $bundleName |
||
| 27 | * @param string|null $version |
||
| 28 | */ |
||
| 29 | public function __construct(Migration $migration, $bundleName = null, $version = null) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return Migration |
||
| 38 | */ |
||
| 39 | public function getMigration() |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | public function getBundleName() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function getVersion() |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return boolean |
||
| 62 | */ |
||
| 63 | public function isSuccessful() |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Marks a migration as successfully finished |
||
| 70 | */ |
||
| 71 | public function setSuccessful() |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Marks a migration as failed |
||
| 78 | */ |
||
| 79 | public function setFailed() |
||
| 83 | } |
||
| 84 |