PHP code example of snowio / volo-data-model

1. Go to this page and download the library: Download snowio/volo-data-model library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

snowio / volo-data-model example snippets


 
    use SnowIO\VoloDataModel\Command\ImportProductDataCommand;
    use SnowIO\VoloDataModel\ProductImport\ImportData;
    use SnowIO\VoloDataModel\ProductImport\ImportRow;
    use SnowIO\VoloDataModel\ProductImport\ImportRowCollection;
    use SnowIO\VoloDataModel\ProductImport\ImportFieldSet;
    use SnowIO\VoloDataModel\ProductImport\ImportField;
    use SnowIO\VoloDataModel\ProductImport\Layout;
    use SnowIO\VoloDataModel\ProductImport\LayoutField;
    
    $layout = Layout::of('Custom Layout', 'StockNumber')
        ->withLayoutField(LayoutField::of('StockNumber'));
    $importRowCollection = ImportRowCollection::of([
        ImportRow::create()
            ->withImportFields(ImportFieldSet::of([
                ImportField::of('StockNumber', '3827893279-IK89'),
            ])),
    ]);
    $importData = ImportData::create()->withImportRows($importRowCollection);
    $importProductDataCommand = ImportProductDataCommand::of($layout, $importData);


    use SnowIO\VoloDataModel\Command\UpdateOrderCommand;
    use SnowIO\VoloDataModel\OrderUpdate\OrderStatus;
    use SnowIO\VoloDataModel\OrderUpdate\OrderUpdate;
    use SnowIO\VoloDataModel\OrderUpdate\OrderUpdateCollection;
        
    $updateOrderCommand = UpdateOrderCommand::of(OrderUpdateCollection::of([
            OrderUpdate::create()
                ->withEspOrderNo(28393283)
                ->withOrderStatus(OrderStatus::WAITING_FOR_DELIVERY)
                ->withOnHoldNotes("string")
                ->withCourier("string"),
            OrderUpdate::create()
                ->withEspOrderNo(76863823)
                ->withOrderStatus(OrderStatus::WAITING_FOR_DELIVERY)
                ->withOnHoldNotes("string")
                ->withCourier("string"),
     ]));