| 1 |
<?php |
| 2 |
namespace Depicter\Document; |
| 3 |
|
| 4 |
use Depicter\Document\Migrations\DocumentMigration; |
| 5 |
use WPEmerge\ServiceProviders\ServiceProviderInterface; |
| 6 |
|
| 7 |
/** |
| 8 |
* Load document data manager. |
| 9 |
*/ |
| 10 |
class ServiceProvider implements ServiceProviderInterface { |
| 11 |
|
| 12 |
/** |
| 13 |
* {@inheritDoc} |
| 14 |
*/ |
| 15 |
public function register( $container ) { |
| 16 |
$app = $container[ WPEMERGE_APPLICATION_KEY ]; |
| 17 |
|
| 18 |
$container[ 'depicter.document.mapper' ] = function () { |
| 19 |
return new Mapper(); |
| 20 |
}; |
| 21 |
$container[ 'depicter.document.manager' ] = function () { |
| 22 |
return new Manager(); |
| 23 |
}; |
| 24 |
|
| 25 |
$container[ 'depicter.document.data.migration' ] = function () { |
| 26 |
return new DocumentMigration(); |
| 27 |
}; |
| 28 |
|
| 29 |
$app->alias( 'document', 'depicter.document.manager' ); |
| 30 |
$app->alias( 'documentMigration', 'depicter.document.data.migration' ); |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* {@inheritDoc} |
| 35 |
*/ |
| 36 |
public function bootstrap( $container ) { |
| 37 |
\Depicter::document()->bootstrap(); |
| 38 |
} |
| 39 |
|
| 40 |
} |
| 41 |
|