| 1 |
<?php |
| 2 |
namespace Depicter\DataSources; |
| 3 |
|
| 4 |
use Depicter\DataSources\Tags\ACF; |
| 5 |
use Depicter\DataSources\Tags\Catalog; |
| 6 |
use Depicter\DataSources\Tags\Legacy; |
| 7 |
use Depicter\DataSources\Tags\Post; |
| 8 |
use Depicter\DataSources\Tags\MetaBoxIO; |
| 9 |
use Depicter\DataSources\Tags\MetaFields; |
| 10 |
use Depicter\DataSources\Tags\Product; |
| 11 |
use Depicter\DataSources\Tags\Taxonomy; |
| 12 |
use WPEmerge\ServiceProviders\ServiceProviderInterface; |
| 13 |
|
| 14 |
|
| 15 |
class ServiceProvider implements ServiceProviderInterface |
| 16 |
{ |
| 17 |
/** |
| 18 |
* {@inheritDoc} |
| 19 |
*/ |
| 20 |
public function register( $container ) { |
| 21 |
$app = $container[ WPEMERGE_APPLICATION_KEY ]; |
| 22 |
|
| 23 |
// register dataSource manager |
| 24 |
$container[ 'depicter.dataSources.dataSource' ] = function () { |
| 25 |
return new Manager(); |
| 26 |
}; |
| 27 |
$app->alias( 'dataSource', 'depicter.dataSources.dataSource' ); |
| 28 |
|
| 29 |
|
| 30 |
// register posts dataSource |
| 31 |
$container[ 'depicter.dataSources.posts' ] = function () { |
| 32 |
return new Posts(); |
| 33 |
}; |
| 34 |
|
| 35 |
// register products dataSource |
| 36 |
$container[ 'depicter.dataSources.products' ] = function () { |
| 37 |
return new Products(); |
| 38 |
}; |
| 39 |
|
| 40 |
// register handpicked products dataSource |
| 41 |
$container[ 'depicter.dataSources.handPickedProducts' ] = function () { |
| 42 |
return new HandPickedProducts(); |
| 43 |
}; |
| 44 |
|
| 45 |
// register catalog dataSource |
| 46 |
$container[ 'depicter.dataSources.catalogs' ] = function () { |
| 47 |
return new Catalogs(); |
| 48 |
}; |
| 49 |
|
| 50 |
// dynamic tag modules |
| 51 |
$container[ 'depicter.dataSources.tags.manager' ] = function () { |
| 52 |
return new \Depicter\DataSources\Tags\Manager(); |
| 53 |
}; |
| 54 |
|
| 55 |
$container[ 'depicter.dataSources.tags.legacy' ] = function () { |
| 56 |
return new Legacy(); |
| 57 |
}; |
| 58 |
|
| 59 |
$container[ 'depicter.dataSources.tags.post' ] = function () { |
| 60 |
return new Post(); |
| 61 |
}; |
| 62 |
|
| 63 |
$container[ 'depicter.dataSources.tags.taxonomy' ] = function () { |
| 64 |
return new Taxonomy(); |
| 65 |
}; |
| 66 |
|
| 67 |
$container[ 'depicter.dataSources.tags.product' ] = function () { |
| 68 |
return new Product(); |
| 69 |
}; |
| 70 |
|
| 71 |
$container[ 'depicter.dataSources.tags.acf' ] = function () { |
| 72 |
return new ACF(); |
| 73 |
}; |
| 74 |
|
| 75 |
$container[ 'depicter.dataSources.tags.metaboxio' ] = function () { |
| 76 |
return new MetaBoxIO(); |
| 77 |
}; |
| 78 |
|
| 79 |
$container[ 'depicter.dataSources.tags.metafield' ] = function () { |
| 80 |
return new MetaFields(); |
| 81 |
}; |
| 82 |
|
| 83 |
$container[ 'depicter.dataSources.tags.catalog' ] = function () { |
| 84 |
return new Catalog(); |
| 85 |
}; |
| 86 |
} |
| 87 |
|
| 88 |
/** |
| 89 |
* {@inheritDoc} |
| 90 |
*/ |
| 91 |
public function bootstrap( $container ) {} |
| 92 |
} |
| 93 |
|