PHP code example of vgrish / mindbox-ms2

1. Go to this page and download the library: Download vgrish/mindbox-ms2 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/ */

    

vgrish / mindbox-ms2 example snippets


core/components/mindbox-ms2/config.php

core/components/mindbox-ms2/cli/cron.php

/** @var Vgrish\MindBox\MS2\App $app */
if ($app = $modx->services[\Vgrish\MindBox\MS2\App::NAME] ?? null) {
    $worker = new \Vgrish\MindBox\MS2\Workers\Nomenclature\AddToWishList($app, [
        'props' => [
            'method' => 'add',
            'key' => '1', // идентификатор ресурса
        ],
    ]);
    $worker->run();
}

/** @var Vgrish\MindBox\MS2\App $app */
if ($app = $modx->services[\Vgrish\MindBox\MS2\App::NAME] ?? null) {
    $worker = new \Vgrish\MindBox\MS2\Workers\Nomenclature\RemoveFromWishList($app, [
        'props' => [
            'method' => 'remove',
            'key' => '1', // идентификатор ресурса
        ],
    ]);
    $worker->run();
}

/** @var Vgrish\MindBox\MS2\App $app */
if ($app = $modx->services[\Vgrish\MindBox\MS2\App::NAME] ?? null) {
    $worker = new \Vgrish\MindBox\MS2\Workers\Nomenclature\ClearWishList($app, [
        'props' => [
            'method' => 'clear',
        ],
    ]);
    $worker->run();
}