Attachments.php
1 year ago
Attributes.php
4 months ago
DownloadableFiles.php
4 months ago
Linked.php
10 months ago
Meta.php
1 year ago
Post.php
3 months ago
Stock.php
1 year ago
Synchronizer.php
1 year ago
SynchronizerForMeta.php
9 months ago
Taxonomies.php
4 months ago
VariationAttachments.php
1 year ago
VariationMeta.php
8 months ago
VariationTaxonomies.php
8 months ago
Variations.php
1 month ago
Synchronizer.php
54 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Synchronization\Component; |
| 4 | |
| 5 | use WCML\Utilities\SyncHash; |
| 6 | |
| 7 | abstract class Synchronizer { |
| 8 | |
| 9 | /** @var \woocommerce_wpml */ |
| 10 | protected $woocommerceWpml; |
| 11 | |
| 12 | /** @var \SitePress */ |
| 13 | protected $sitepress; |
| 14 | |
| 15 | /** @var \WPML_Element_Translation */ |
| 16 | protected $elementTranslations; |
| 17 | |
| 18 | /** @var \wpdb */ |
| 19 | protected $wpdb; |
| 20 | |
| 21 | /** @var SyncHash */ |
| 22 | protected $syncHashManager; |
| 23 | |
| 24 | /** |
| 25 | * @param \woocommerce_wpml $woocommerceWpml |
| 26 | * @param \SitePress $sitepress |
| 27 | * @param \WPML_Element_Translation $elementTranslations |
| 28 | * @param \wpdb $wpdb |
| 29 | * @param SyncHash $syncHashManager |
| 30 | */ |
| 31 | public function __construct( |
| 32 | \woocommerce_wpml $woocommerceWpml, |
| 33 | \SitePress $sitepress, |
| 34 | \WPML_Element_Translation $elementTranslations, |
| 35 | \wpdb $wpdb, |
| 36 | SyncHash $syncHashManager |
| 37 | ) { |
| 38 | $this->woocommerceWpml = $woocommerceWpml; |
| 39 | $this->sitepress = $sitepress; |
| 40 | $this->elementTranslations = $elementTranslations; |
| 41 | $this->wpdb = $wpdb; |
| 42 | $this->syncHashManager = $syncHashManager; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * @param \WP_Post $product |
| 47 | * @param int[] $translationsIds |
| 48 | * @param array<int,string> $translationsLanguages |
| 49 | */ |
| 50 | abstract public function run( $product, $translationsIds, $translationsLanguages ); |
| 51 | |
| 52 | } |
| 53 | |
| 54 |