opcvm360/sdk-symfony2

A Symfony2 Bundle for OPCVM360 APIs - wrapper of https://github.com/OPCVM360/sdk-php

This package's canonical repository appears to be gone and the package has been frozen as a result.

dev-master 2014-02-17 14:01 UTC

This package is not auto-updated.

Last update: 2019-12-13 14:30:47 UTC


README

#Symfony2 OPCVM360 Wrapper Bundle

About

This is just a wrapper for the official SDK.

Installation

Add this to your composer.json file:

"require": {
	"OPCVM360/sdk-symfony2": "dev-master",
}

Add the bundle to app/AppKernel.php

$bundles = array(
	// ... other bundles
	new OPCVM360\WrapperBundle\OPCVM360WrapperBundle(),
);

Configuration

Add this to your config.yml:

opcvm360:
    #(Required) Your Login from http://www.opcvm360.com
    login: 'My_OPCVM360_Login'
    #(Required) Your Password from http://www.opcvm360.com
    password: 'My_OPCVM360_Password'
    #(Optional, default: 'http://services.opcvm360.com/api-v1/') OPCVM360 base url
    base_url: 'http://services.opcvm360.com/api-v1/'

Usage

Inside a controller:

class TelephoneController extends Controller
{
    public function callAction($me, $maybee)
    {
        //returns an instance of OPCVM360\WrapperBundle\Service\OPCVM360Wrapper
    	$opcvm360 = $this->get('opcvm360.api');


        //inputs
        $isin="LU0068578508";		//FIRST EAGLE AMUNDI INTERNATIONAL
        $HistoryFrom="2013-01-01";	//from jan 1st 2013
        $HistoryTo=Null;			//till now


        //retrieve the fundShare by its ISIN
        $fundShare = $opcvm360->getFundShareByIsin($isin);

        //retrieve history of that fundShare, for the specified range of dates
        //the $fundShareHistory object act as an iterator
        $fundShareHistory = $fundShare->getHistoryRange($HistoryFrom,$HistoryTo);

        ....
    }
}

Inside a console command:

class SomeCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('some:comand')
            ->setDescription('A command')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        //returns an instance of OPCVM360\WrapperBundle\Service\OPCVM360Wrapper
        $opcvm360 = $this->getContainer()->get('opcvm360.api');
        .....
    }
}

Copyright / License

See LICENSE