PHP code example of clickandmortar / import-bundle

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

    

clickandmortar / import-bundle example snippets



// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new ClickAndMortar\ImportBundle\ClickAndMortarImportBundle(),
        ];

        // ...
    }

    // ...
}



namespace YourOrganizationName\YourBundle\Reader\Readers;

use ClickAndMortar\ImportBundle\Reader\AbstractReader;

/**
 * Class MyCustomXmlReader
 *
 * @package YourOrganizationName\YourBundle\Reader\Readers
 */
class MyCustomXmlReader extends AbstractReader
{
    /**
     * Read my custom XML file and return data array
     *
     * @param string $path
     *
     * @return array
     */
    public function read($path)
    {
        $data = array();

        // ...

        return $data;
    }

    /**
     * Support only xml type
     *
     * @param string $type
     *
     * @return bool
     */
    public function support($type)
    {
        return $type == 'xml';
    }
}