| 1 |
<?php |
| 2 |
namespace Depicter\DataSources; |
| 3 |
|
| 4 |
use WPEmerge\ServiceProviders\ServiceProviderInterface; |
| 5 |
|
| 6 |
class ServiceProvider implements ServiceProviderInterface |
| 7 |
{ |
| 8 |
/** |
| 9 |
* {@inheritDoc} |
| 10 |
*/ |
| 11 |
public function register( $container ) { |
| 12 |
$app = $container[ WPEMERGE_APPLICATION_KEY ]; |
| 13 |
|
| 14 |
// register dataSource manager |
| 15 |
$container[ 'depicter.dataSources.dataSource' ] = function () { |
| 16 |
return new Manager(); |
| 17 |
}; |
| 18 |
$app->alias( 'dataSource', 'depicter.dataSources.dataSource' ); |
| 19 |
|
| 20 |
// register posts dataSource |
| 21 |
$container[ 'depicter.dataSources.posts' ] = function () { |
| 22 |
return new Posts(); |
| 23 |
}; |
| 24 |
|
| 25 |
// register products dataSource |
| 26 |
$container[ 'depicter.dataSources.products' ] = function () { |
| 27 |
return new Products(); |
| 28 |
}; |
| 29 |
|
| 30 |
// register hand picked products dataSource |
| 31 |
$container[ 'depicter.dataSources.handPickedProducts' ] = function () { |
| 32 |
return new HandPickedProducts(); |
| 33 |
}; |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* {@inheritDoc} |
| 38 |
*/ |
| 39 |
public function bootstrap( $container ) {} |
| 40 |
} |
| 41 |
|