# sync-basalam/trunk/includes/Admin/ProductService.php

ووسلام – همگام سازی ووکامرس و باسلام, version trunk. 48 lines.

- Page: https://pluginprobe.com/plugins/sync-basalam/trunk/code/includes/Admin/ProductService.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/trunk/raw/includes/Admin/ProductService.php
- Modified: 2026-05-03T10:52:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sync-basalam/trunk/code/includes/Admin/ProductService.php#L10-L20`.

```php
<?php

namespace SyncBasalam\Admin;

use SyncBasalam\Admin\Product\Services\ProductQueryService;
use SyncBasalam\Admin\Product\Services\ProductSyncService;
use SyncBasalam\Admin\Product\Services\ProductDisconnectService;

defined('ABSPATH') || exit;

class ProductService
{
    public static function enqueueAllProductsForCreation($includeOutOfStock = false, $postsPerPage = 100)
    {
        return (new ProductSyncService())->enqueueBulkCreate($includeOutOfStock, $postsPerPage);
    }

    public static function enqueueSelectedProductsForCreation($productIds): void
    {
        if (is_array($productIds)) (new ProductSyncService())->enqueueSelectedForCreate($productIds);
    }

    public static function getCreatableProducts($args = []): array
    {
        return (new ProductQueryService())->getCreatableProducts($args);
    }

    public static function enqueueSelectedProductsForUpdate($productIds): void
    {
        if (is_array($productIds)) (new ProductSyncService())->enqueueSelectedForUpdate($productIds);
    }

    public static function disconnectSelectedProducts($productIds): void
    {
        if (is_array($productIds)) (new ProductDisconnectService())->disconnectSelected($productIds);
    }

    public static function getUpdatableProducts($args = []): array
    {
        return (new ProductQueryService())->getUpdatableProducts($args);
    }

    public static function autoConnectAllProducts($cursor = null): void
    {
        (new ProductSyncService())->enqueueAutoConnect($cursor);
    }
}

```
