@@ 7-44 (lines=38) @@ | ||
4 | ||
5 | use Consigliere\Components\Migrations\Migrator; |
|
6 | ||
7 | class MigrationPublisher extends AssetPublisher |
|
8 | { |
|
9 | /** |
|
10 | * @var Migrator |
|
11 | */ |
|
12 | private $migrator; |
|
13 | ||
14 | /** |
|
15 | * MigrationPublisher constructor. |
|
16 | * |
|
17 | * @param Migrator $migrator |
|
18 | */ |
|
19 | public function __construct(Migrator $migrator) |
|
20 | { |
|
21 | $this->migrator = $migrator; |
|
22 | parent::__construct($migrator->getComponent()); |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * Get destination path. |
|
27 | * |
|
28 | * @return string |
|
29 | */ |
|
30 | public function getDestinationPath() |
|
31 | { |
|
32 | return $this->repository->config('paths.migration'); |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * Get source path. |
|
37 | * |
|
38 | * @return string |
|
39 | */ |
|
40 | public function getSourcePath() |
|
41 | { |
|
42 | return $this->migrator->getPath(); |
|
43 | } |
|
44 | } |
|
45 |
@@ 7-44 (lines=38) @@ | ||
4 | ||
5 | use Consigliere\Components\Migrations\Seeder; |
|
6 | ||
7 | class SeedPublisher extends AssetPublisher |
|
8 | { |
|
9 | /** |
|
10 | * @var Seeder |
|
11 | */ |
|
12 | private $seeder; |
|
13 | ||
14 | /** |
|
15 | * MigrationPublisher constructor. |
|
16 | * |
|
17 | * @param Seeder $seeder |
|
18 | */ |
|
19 | public function __construct(Seeder $seeder) |
|
20 | { |
|
21 | $this->seeder = $seeder; |
|
22 | parent::__construct($seeder->getComponent()); |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * Get destination path. |
|
27 | * |
|
28 | * @return string |
|
29 | */ |
|
30 | public function getDestinationPath() |
|
31 | { |
|
32 | return $this->repository->config('paths.seed'); |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * Get source path. |
|
37 | * |
|
38 | * @return string |
|
39 | */ |
|
40 | public function getSourcePath() |
|
41 | { |
|
42 | return $this->seeder->getPath(); |
|
43 | } |
|
44 | } |
|
45 |