Skip to content

Commit

Permalink
Merge pull request #4 from vhx/v1.0.1
Browse files Browse the repository at this point in the history
add video files method, bump version
  • Loading branch information
scottusrobus committed Dec 22, 2015
2 parents 1d0a16d + 6260b1f commit c00a5b2
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 1.0.1
**2015-12-21**

* Add method for video > files endpoint

### 1.0.0
**2015-12-19**

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
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.0",
"version": "1.0.1",
"description": "VHX PHP API Wrapper",
"keywords": [
"vhx",
Expand Down
2 changes: 1 addition & 1 deletion lib/api.php → 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.0';
const VERSION = '1.0.1';

public static function setKey($api_key) {
self::$key = $api_key;
Expand Down
2 changes: 1 addition & 1 deletion 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) {
public static function items($id = null) {
return self::_update($id);
}
}
5 changes: 4 additions & 1 deletion lib/Videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ class Videos extends Resource {
public static function all($params = array()) {
return self::_list($params);
}
public static function files($id = null, $params = array()) {
return self::_files($id, $params);
}
public static function retrieve($id = null) {
return self::_retrieve($id);
}
Expand All @@ -15,7 +18,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) {
public static function items($id = null) {
return self::_update($id);
}
}
9 changes: 7 additions & 2 deletions lib/resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@ protected static function _items($id) {
return self::_request('GET', self::_getResourceName() . '/' . $id . '/items');
}

protected static function _create($params = null) {
protected static function _files($id, $params) {
self::_hasID($id, 'video files');
return self::_request('GET', self::_getResourceName() . '/' . $id . '/files', $params);
}

protected static function _create($params) {
return self::_request('POST', self::_getResourceName() . '/', $params);
}

protected static function _update($id, $params = null) {
protected static function _update($id, $params) {
self::_hasID($id, 'update');
return self::_request('PUT', self::_getResourceName() . '/' . $id, $params);
}
Expand Down

0 comments on commit c00a5b2

Please sign in to comment.