PHP code example of mobizel / sylius-export-plugin

1. Go to this page and download the library: Download mobizel/sylius-export-plugin 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/ */

    

mobizel / sylius-export-plugin example snippets




// config/bundles.php

return [
    // ...
   Mobizel\SyliusExportPlugin\MobizelSyliusExportPlugin::class => ['all' => true],
];


declare(strict_types=1);

namespace Tests\Mobizel\SyliusExportPlugin\Application\src\Repository;

use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\CoreBundle\Doctrine\ORM\CustomerRepository as BaseCustomerRepository;

class CustomerRepository extends BaseCustomerRepository
{
    public function createListQueryBuilderFilteredByIds(?array $ids): QueryBuilder
    {
        $queryBuilder = $this->createQueryBuilder('o');

        if (null !== $ids && count($ids) > 0) {
            $queryBuilder
                ->andWhere($queryBuilder->expr()->in('o.id', ':ids'))
                ->setParameter('ids', $ids);
        }

        return $queryBuilder;
    }
}

    public function getFormat(): string
    {
        return 'xml';
    }