2017 © Pedro Peláez
 

project yii2-connect

The getconnect.io API for Yii2

image

br0sk/yii2-connect

The getconnect.io API for Yii2

  • Saturday, July 25, 2015
  • by br0sk
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

yii2-connect

A Yii2 extension for http://getconnect.io/, (*1)

This is an extension for Yii2 that makes it easy to use http://getconnect.io/., (*2)

Right now their PHP SDK only supports pushing events., (*3)

You can configure it in your application configuration like so:, (*4)

'connect' => [
    'class' => 'br0sk\connect\Connect',
    'projectId' => 'yourprojectid',
    'pushApiKey'    => 'yourpushapikey',
]

note: You can find the project id and push API key in the control panel for you project here., (*5)

Adding it to your components array., (*6)

Pushing an event is as easy as:, (*7)

    $event = ['purchase' => ['item' => 'My item 1']];
    Yii::$app->connect->push('purchases', $event);

You can also push multiple events at once like this:, (*8)

$batch = [
    'purchases' => [
        [
            'customer' => [
            'firstName' => 'Tom',
            'lastName' => 'Smith'
            ],
            'product' => '12 red roses',
            'purchasePrice' => 34.95
        ],
        [
            'customer' => [
            'firstName' => 'Fred',
            'lastName' => 'Jones'
            ],
            'product' => '12 pink roses',
            'purchasePrice' => 38.95
        ]
    ]
    ];

Yii::$app->connect->push($batch);

Exception handling, (*9)

When pushing events, exceptions could be thrown, so you should either ignore or handle those exceptions gracefully., (*10)

Currently, the following exception could be thrown when pushing events: * InvalidEventException - the event being pushed is invalid (e.g. invalid event properties), (*11)

The Versions

25/07 2015

dev-master

9999999-dev http://br0sk.blogspot.com

The getconnect.io API for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

statistics yii2 getconnect.io

25/07 2015

0.1.1

0.1.1.0 http://br0sk.blogspot.com

The getconnect.io API for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

statistics yii2 getconnect.io

25/07 2015

0.1.0

0.1.0.0 http://br0sk.blogspot.com

The getconnect.io API for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

statistics yii2 getconnect.io