Factory.php
2 weeks ago
JobHooks.php
2 weeks ago
MulticurrencyHooks.php
2 weeks ago
SharedHooks.php
2 weeks ago
class-wcml-product-addons.php
2 weeks ago
Factory.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Compatibility\WcProductAddons; |
| 4 | |
| 5 | use WCML\PointerUi\Factory as PointerFactory; |
| 6 | use WCML\Compatibility\ComponentFactory; |
| 7 | use WCML\StandAlone\IStandAloneAction; |
| 8 | use function WCML\functions\getSitePress; |
| 9 | use function WCML\functions\getWooCommerceWpml; |
| 10 | use function WCML\functions\isStandAlone; |
| 11 | |
| 12 | class Factory extends ComponentFactory implements IStandAloneAction { |
| 13 | |
| 14 | public function create() { |
| 15 | $hooks = [ |
| 16 | new SharedHooks(), |
| 17 | ]; |
| 18 | |
| 19 | if ( wcml_is_multi_currency_on() ) { |
| 20 | $hooks[] = new MulticurrencyHooks( getWooCommerceWpml() ); |
| 21 | } |
| 22 | |
| 23 | if ( ! isStandAlone() ) { |
| 24 | $hooks[] = new \WCML_Product_Addons( getSitePress(), new PointerFactory() ); |
| 25 | $hooks[] = new JobHooks(); |
| 26 | } |
| 27 | |
| 28 | return $hooks; |
| 29 | } |
| 30 | } |
| 31 |