Commit 5f5dbb1d authored by 王源's avatar 王源
Browse files

添加库存相关shopify底层库文件

parent ac44eeed
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@ use Meibuyu\Micro\Shopify\lib\AbstractShopify;
use Meibuyu\Micro\Shopify\lib\Collect;
use Meibuyu\Micro\Shopify\lib\Collection;
use Meibuyu\Micro\Shopify\lib\CustomCollection;
use Meibuyu\Micro\Shopify\lib\InventoryItem;
use Meibuyu\Micro\Shopify\lib\InventoryLevel;
use Meibuyu\Micro\Shopify\lib\Location;
use Meibuyu\Micro\Shopify\lib\Metafield;
use Meibuyu\Micro\Shopify\lib\Product;
use Meibuyu\Micro\Shopify\lib\ProductVariant;
@@ -31,6 +34,9 @@ use Meibuyu\Micro\Shopify\lib\Webhook;
 * @property-read Metafield $Metafield
 * @property-read Product $Product
 * @property-read ProductVariant $ProductVariant
 * @property-read InventoryItem $InventoryItem
 * @property-read InventoryLevel $InventoryLevel
 * @property-read Location $Location
 *
 * @method Webhook Webhook(integer $id = null)
 * @method Collection Collection(integer $id = null)
@@ -39,6 +45,9 @@ use Meibuyu\Micro\Shopify\lib\Webhook;
 * @method Metafield Metafield(integer $id = null)
 * @method Product Product(integer $id = null)
 * @method ProductVariant ProductVariant(integer $id = null)
 * @method InventoryItem InventoryItem(integer $id = null)
 * @method InventoryLevel InventoryLevel(integer $id = null)
 * @method Location Location(integer $id = null)
 *
 */
class ShopifyApp
@@ -53,6 +62,9 @@ class ShopifyApp
        'Metafield',
        'Product',
        'ProductVariant',
        'InventoryItem',
        'InventoryLevel',
        'Location',
    ];

    protected $childResources = array(
+16 −0
Original line number Diff line number Diff line
<?php
/**
 * Created by PhpStorm.
 * User: Zero
 * Date: 2020/9/23
 * Time: 8:58
 */

namespace Meibuyu\Micro\Shopify\lib;

class InventoryItem extends AbstractShopify
{

    protected $resourceKey = 'inventory_item';

}
+30 −0
Original line number Diff line number Diff line
<?php
/**
 * Created by PhpStorm.
 * User: Zero
 * Date: 2020/9/23
 * Time: 8:58
 */

namespace Meibuyu\Micro\Shopify\lib;

/**
 * Class InventoryLevel
 * @package Meibuyu\Micro\Shopify\lib
 *
 * @method array adjust($data)  Adjust inventory level.
 * @method array connect($data) Connect an inventory item to a location.
 * @method array set($data)     Sets an inventory level for a single inventory item within a location.
 */
class InventoryLevel extends AbstractShopify
{

    protected $resourceKey = 'inventory_level';

    protected $customPostActions = [
        'adjust',
        'connect',
        'set',
    ];

}
+24 −0
Original line number Diff line number Diff line
<?php
/**
 * Created by PhpStorm.
 * User: Zero
 * Date: 2020/9/23
 * Time: 8:58
 */

namespace Meibuyu\Micro\Shopify\lib;

/**
 * Class Location
 * @package Meibuyu\Micro\Shopify\lib
 */
class Location extends AbstractShopify
{

    protected $resourceKey = 'location';

    protected $childResource = [
        'InventoryLevel',
    ];

}