Skip to content

Commit

Permalink
Merge pull request #5 from vhx/v1.1.0
Browse files Browse the repository at this point in the history
V1.1.0
  • Loading branch information
scottusrobus committed Dec 22, 2015
2 parents c00a5b2 + c8aca2d commit 0b4006e
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 27 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### 1.1.0
**2015-12-22**

* Add methods for products api endpoint
* Fix readme links
* Allow parameters for items methods

### 1.0.1
**2015-12-21**

Expand Down
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You can install the bindings via [Composer](http://getcomposer.org/). Add this t
```json
{
"require": {
"vhx/vhx-php": "1.0.*"
"vhx/vhx-php": "1.1.*"
}
}
```
Expand Down Expand Up @@ -63,24 +63,27 @@ $customer = \VHX\Customers::create(array(

### Resources & methods

products
* [`retrieve`](http://dev.vhx.tv/docs/api/?php#product-retrieve)
* [`all`](http://dev.vhx.tv/docs/api/?php#product-list)

customers
* [`create`](http://dev.vhx.tv/docs/api/?php#customer-create)
* [`retrieve`](http://dev.vhx.tv/docs/api/?php#customer-retrieve)
* [`all`](http://dev.vhx.tv/docs/api/?php#customer-list)

videos
* [`create`](http://dev.vhx.tv/docs/api?php#create_customer)
* [`update`](http://dev.vhx.tv/docs/api?php#update_customer)
* [`retrieve`](http://dev.vhx.tv/docs/api?php#retrieve_customer)
* [`all`](http://dev.vhx.tv/docs/api?php#list_customers)
* [`create`](http://dev.vhx.tv/docs/api/?php#videos-create)
* [`retrieve`](http://dev.vhx.tv/docs/api/?php#videos-get)
* [`all`](http://dev.vhx.tv/docs/api/?php#videos-list)
* [`files`](http://dev.vhx.tv/docs/api/?php#videos-list-files)

collections
* [`create`](http://dev.vhx.tv/docs/api?php#create_collection)
* [`update`](http://dev.vhx.tv/docs/api?php#update_collection)
* [`retrieve`](http://dev.vhx.tv/docs/api?php#retrieve_collection)
* [`all`](http://dev.vhx.tv/docs/api?php#list_collections)
* [`items`](http://dev.vhx.tv/docs/api?php#list_collection_items)

customers
* [`create`](http://dev.vhx.tv/docs/api?php#create_customer)
* [`update`](http://dev.vhx.tv/docs/api?php#update_customer)
* [`retrieve`](http://dev.vhx.tv/docs/api?php#retrieve_customer)
* [`all`](http://dev.vhx.tv/docs/api?php#list_customers)
* [`create`](http://dev.vhx.tv/docs/api/?php#collections-create)
* [`update`](http://dev.vhx.tv/docs/api/?php#collections-update)
* [`retrieve`](http://dev.vhx.tv/docs/api/?php#collections-retrieve)
* [`all`](http://dev.vhx.tv/docs/api/?php#collections-list)
* [`items`](http://dev.vhx.tv/docs/api/?php#collection-items-list)

authorizations
* [`create`](http://dev.vhx.tv/docs/api?php#create_authorization)
* [`create`](http://dev.vhx.tv/docs/api/?php#authorizations-create)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.1.0
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vhx/vhx-php",
"version": "1.0.1",
"version": "1.1.0",
"description": "VHX PHP API Wrapper",
"keywords": [
"vhx",
Expand Down
1 change: 1 addition & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require(dirname(__FILE__) . '/lib/Authorizations.php');
require(dirname(__FILE__) . '/lib/Collections.php');
require(dirname(__FILE__) . '/lib/Customers.php');
require(dirname(__FILE__) . '/lib/Products.php');
require(dirname(__FILE__) . '/lib/Videos.php');

// Errors
Expand Down
2 changes: 1 addition & 1 deletion lib/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Api
public static $key;
const HOST = 'api.vhx.tv';
const PROTOCOL = 'https://';
const VERSION = '1.0.1';
const VERSION = '1.1.0';

public static function setKey($api_key) {
self::$key = $api_key;
Expand Down
4 changes: 2 additions & 2 deletions lib/Collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static function create($params = array()) {
public static function update($id = null, $params = array()) {
return self::_update($id, $params);
}
public static function items($id = null) {
return self::_update($id);
public static function items($id = null, $params = array()) {
return self::_update($id, $params);
}
}
3 changes: 0 additions & 3 deletions lib/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ public static function retrieve($id = null) {
public static function create($params = array()) {
return self::_create($params);
}
public static function update($id = null, $params = array()) {
return self::_update($id, $params);
}
}
12 changes: 12 additions & 0 deletions lib/Products.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace VHX;

class Products extends Resource {
public static function all($params = array()) {
return self::_list($params);
}
public static function retrieve($id = null) {
return self::_retrieve($id);
}
}
4 changes: 2 additions & 2 deletions lib/resource.php → lib/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ protected static function _list($params) {
return self::_request('GET', self::_getResourceName() . '/', $params);
}

protected static function _items($id) {
protected static function _items($id, $params) {
self::_hasID($id, 'items');
return self::_request('GET', self::_getResourceName() . '/' . $id . '/items');
return self::_request('GET', self::_getResourceName() . '/' . $id . '/items', $params);
}

protected static function _files($id, $params) {
Expand Down

0 comments on commit 0b4006e

Please sign in to comment.