PHP code example of answear / meest-bundle

1. Go to this page and download the library: Download answear/meest-bundle 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/ */

    

answear / meest-bundle example snippets


use Answear\MeestBundle\Enum\DivisionTypeEnum;
use Answear\MeestBundle\Request\SearchDivisions;
use Answear\MeestBundle\Response\DTO\DivisionDTO;
use Answear\MeestBundle\Response\SearchDivisions as SearchDivisionsResponse;
use Answear\MeestBundle\Service\MeestClient;

// ...

/**
 * @var MeestClient
 */
private $meestClient;

public function __construct(
    ...
    MeestClient $meestClient
) {
    ...
    $this->meestClient = $meestClient;
}

...

public function pickupPoints(): void
{
    /** @var SearchDivisionsResponse $response */
    $response = $this->meestClient->request(new SearchDivisions(DivisionTypeEnum::NovaPoshtaPoint));
    
    /** @var DivisionDTO $division */
    foreach ($response->return as $division) {
        if ($division->active) {
            ...
        }
    }
    ...
}