AdventureTours
1 week ago
Aurum
1 week ago
FacebookForWc
1 week ago
Flatsome
1 week ago
GravityForms
1 week ago
KlarnaPayments
1 week ago
MaxStorePro
1 week ago
PerProductShipping
1 week ago
Relevanssi
1 week ago
Sensei
1 week ago
TableRateShipping
1 week ago
TheEventsCalendar
1 week ago
TmExtraProductOptions
1 week ago
WcAjaxLayeredNav
1 week ago
WcBookings
1 week ago
WcBulkStockManagement
1 week ago
WcCheckoutAddons
1 week ago
WcCheckoutFieldEditor
1 week ago
WcCompositeProducts
1 week ago
WcDynamicPricing
1 week ago
WcExporter
1 week ago
WcMemberships
1 week ago
WcMixAndMatch
1 week ago
WcNameYourPrice
1 week ago
WcOrderStatusManager
1 week ago
WcPip
1 week ago
WcProductAddons
1 week ago
WcProductBundles
1 week ago
WcProductTypeColumn
1 week ago
WcShowSingleVariations
1 week ago
WcSubscriptions
1 week ago
WcSwatches
1 week ago
WcTabManager
1 week ago
WooVariationsTable
1 week ago
WoobeBulkEditor
1 week ago
WoofWcProductFilter
1 week ago
WpBakery
1 week ago
WpFastestCache
1 week ago
WpSeo
1 week ago
WpSuperCache
1 week ago
YikesCustomProductTabs
1 week ago
YithWcQuickView
1 week ago
res
1 year ago
ComponentFactory.php
1 week ago
class-wcml-compatibility-helper.php
4 years ago
ComponentFactory.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Compatibility; |
| 4 | |
| 5 | use WooCommerce; |
| 6 | use wpdb; |
| 7 | use WPML_Element_Translation_Package; |
| 8 | |
| 9 | abstract class ComponentFactory implements \IWPML_Backend_Action_Loader, \IWPML_Frontend_Action_Loader { |
| 10 | |
| 11 | abstract public function create(); |
| 12 | |
| 13 | protected static function getWpdb() { |
| 14 | global $wpdb; |
| 15 | |
| 16 | return $wpdb; |
| 17 | } |
| 18 | |
| 19 | protected static function getWooCommerce() { |
| 20 | global $woocommerce; |
| 21 | |
| 22 | return $woocommerce; |
| 23 | } |
| 24 | |
| 25 | protected static function getElementTranslationPackage() { |
| 26 | return class_exists( 'WPML_Element_Translation_Package' ) ? new WPML_Element_Translation_Package() : null; |
| 27 | } |
| 28 | |
| 29 | protected static function getPostTranslations() { |
| 30 | global $wpml_post_translations; |
| 31 | |
| 32 | return $wpml_post_translations; |
| 33 | } |
| 34 | } |
| 35 |