Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function up() |
||
32 | { |
||
33 | $this->info( 'Adding cms test data', 'vv' ); |
||
34 | $this->context()->setEditor( 'ai-cms-grapesjs' ); |
||
|
|||
35 | |||
36 | $path = __DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cms.php'; |
||
37 | |||
38 | if( ( $testdata = include( $path ) ) == false ) { |
||
39 | throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for cms domain', $path ) ); |
||
40 | } |
||
41 | |||
42 | $manager = $this->getManager( 'cms' ); |
||
43 | $manager->begin(); |
||
44 | |||
45 | foreach( $testdata['cms'] as $entry ) |
||
46 | { |
||
47 | $item = $manager->create()->fromArray( $entry ); |
||
48 | $item = $this->addListData( $manager, $item, $entry ); |
||
49 | |||
50 | $manager->save( $item ); |
||
51 | } |
||
52 | |||
53 | $manager->commit(); |
||
54 | } |
||
56 |