2017 © Pedro PelĂĄez
 

library magento-bundle

A Symfony2 wrapper for the Magento Soap Client API

image

smalot/magento-bundle

A Symfony2 wrapper for the Magento Soap Client API

  • Friday, November 25, 2016
  • by smalot
  • Repository
  • 3 Watchers
  • 8 Stars
  • 2,684 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 1 Open issues
  • 5 Versions
  • 6 % Grown

The README.md

MagentoBundle

This project is a bridge between Symfony 2 and Magento-Client API which allow to call easily the Magento Soap v1 API., (*1)

Scrutinizer Code Quality Total Downloads Current Version License, (*2)

Allows : - wrappers for each call - dependencies injections - event listeners - debug toolbar integration - and ... code completion, (*3)

Requirements

  • Symfony >= 2.1
  • PHP >= 5.3
  • smalot/magento-client

Installation

Add the following lines to your composer.json:, (*4)

{
    "require": {
        "smalot/magento-bundle": "*"
    }
}

And run php composer.phar update smalot/magento-bundle, (*5)

Then, register the bundle in your kernel:, (*6)

# app/AppKernel.php

# ...

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            # ...
            new Smalot\MagentoBundle\MagentoBundle(),
        );

        return $bundles;
    }
}

Configuration

You need to setup at least one connection in the connections pool and specify it with the default_connection property. The mandatory properties are: url, api_user and api_key., (*7)

# app/config/config.yml

# Sample configuration
magento:
    # Refers to the default connection in the connection pool
    default_connection:   default # Example: default

    # List all available connections
    connections:

        # Prototype
        default:
            url:                  http://domain.tld/magento/
            api_user:             username
            api_key:              0123456789AZ

            # Enable logging system
            logging:              %kernel.debug%

            # Refers to the logger service
            logger:               ~

            # Refers to the dispatcher service
            dispatcher:           ~

Details

Service(s) provided: - magento, (*8)

Events thrown in security context: - \Smalot\MagentoBundle\MagentoEvents::PRE_LOGIN - \Smalot\MagentoBundle\MagentoEvents::POST_LOGIN - \Smalot\MagentoBundle\MagentoEvents::PRE_LOGOUT - \Smalot\MagentoBundle\MagentoEvents::POST_LOGOUT, (*9)

Events thrown in transport context: - \Smalot\MagentoBundle\MagentoEvents::PRE_SINGLE_CALL - \Smalot\MagentoBundle\MagentoEvents::POST_SINGLE_CALL - \Smalot\MagentoBundle\MagentoEvents::PRE_MULTI_CALL - \Smalot\MagentoBundle\MagentoEvents::POST_MULTI_CALL, (*10)

Sample codes

Using the default connection:, (*11)

class MagentoController extends Controller
{
    /**
     * @Route("/", name="magento_index")
     */
    public function indexAction(Request $request)
    {
        // Retrieve default connection.
        $magento = $this->get('magento')->getManager();

        if ($magento->ping()) {
            // Call any module's class.
            $categoryManager = new \Smalot\Magento\Catalog\Category($magento);
            $tree            = $categoryManager->getTree()->execute();
        } else {
            $tree = array();
        }

        $magento->logout();

        return new Response('<html><body><pre>' . var_export($tree, true) . '</pre></body></html>');
    }
}

The connection can be specified manually if needed:, (*12)

$magento = $this->get('magento')->getManager('second_connection_name');

The Versions

25/11 2016

dev-master

9999999-dev

A Symfony2 wrapper for the Magento Soap Client API

  Sources   Download

MIT

The Requires

 

25/11 2016

v0.4

0.4.0.0

A Symfony2 wrapper for the Magento Soap Client API

  Sources   Download

MIT

The Requires

 

08/05 2014

v0.3

0.3.0.0

A Symfony2 wrapper for the Magento Soap Client API

  Sources   Download

MIT

The Requires

 

08/05 2014

v0.2

0.2.0.0

A Symfony2 wrapper for the Magento Soap Client API

  Sources   Download

MIT

The Requires

 

08/05 2014

v0.1

0.1.0.0

A Symfony2 wrapper for the Magento Soap Client API

  Sources   Download

MIT

The Requires