Templates
2 weeks ago
TranslationEditor
2 weeks ago
Calendar.php
1 year ago
Emails.php
2 weeks ago
Factory.php
2 weeks ago
MulticurrencyHooks.php
2 weeks ago
Prices.php
2 weeks ago
SharedHooks.php
2 weeks ago
Slots.php
2 weeks ago
class-wcml-accommodation-bookings.php
2 weeks ago
class-wcml-bookings.php
2 weeks ago
Factory.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Compatibility\WcBookings; |
| 4 | |
| 5 | use WCML\Compatibility\ComponentFactory; |
| 6 | use WCML\StandAlone\IStandAloneAction; |
| 7 | use function WCML\functions\getSitePress; |
| 8 | use function WCML\functions\getWooCommerceWpml; |
| 9 | use function WCML\functions\isStandAlone; |
| 10 | |
| 11 | class Factory extends ComponentFactory implements IStandAloneAction { |
| 12 | |
| 13 | public function create() { |
| 14 | $hooks = [ |
| 15 | new SharedHooks( self::getWpdb() ), |
| 16 | ]; |
| 17 | |
| 18 | if ( wcml_is_multi_currency_on() ) { |
| 19 | $hooks[] = new MulticurrencyHooks( getWooCommerceWpml() ); |
| 20 | $hooks[] = new Prices(); |
| 21 | } |
| 22 | |
| 23 | if ( ! isStandAlone() ) { |
| 24 | $hooks[] = new \WCML_Bookings( |
| 25 | getSitePress(), |
| 26 | getWooCommerceWpml(), |
| 27 | self::getWpdb(), |
| 28 | self::getElementTranslationPackage(), |
| 29 | self::getPostTranslations() |
| 30 | ); |
| 31 | $hooks[] = new Emails( getSitePress(), getWooCommerceWpml(), self::getWooCommerce() ); |
| 32 | $hooks[] = new Templates\MyBookings(); |
| 33 | $hooks[] = new Calendar(); |
| 34 | $hooks[] = new Slots(); |
| 35 | $hooks[] = new TranslationEditor\GroupsAndLabels(); |
| 36 | } |
| 37 | |
| 38 | if ( defined( 'WC_ACCOMMODATION_BOOKINGS_VERSION' ) && wcml_is_multi_currency_on() ) { |
| 39 | $hooks[] = new \WCML_Accommodation_Bookings( getWooCommerceWpml() ); |
| 40 | } |
| 41 | |
| 42 | return $hooks; |
| 43 | } |
| 44 | } |
| 45 |