Skip to content

Commit

Permalink
Merge pull request #2 from suhasindra/collection_api_v1.7.0
Browse files Browse the repository at this point in the history
Collection API interaction. API v1.7.0
  • Loading branch information
anagh-p committed Feb 21, 2017
2 parents d3bdf99 + 1aa119c commit e389173
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Quintype/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function __construct($apiHost)
$this->menu = new Menu();
$this->breakingNews = new BreakingNews($this->client);
$this->contactUs = new ContactUs($this->client);
$this->collections = new Collections($this->client);
}

public function config()
Expand Down Expand Up @@ -156,4 +157,9 @@ public function getBreakingNews($params = [])
public function postContactUs($data) {
return $this->contactUs->postContact($data);
}

//Version 1.7.0 onwards
public function getCollections($collection, $params) {
return $this->collections->getCollections($collection, $params);
}
}
23 changes: 23 additions & 0 deletions src/Quintype/Api/Collections.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Quintype\Api;

class Collections
{
public function __construct($client)
{
$this->base = new BaseFunctions($client);
}

public function getCollections($collection, $params)
{
$query = '/api/v1/collections/'.$collection;
$response = $this->base->getResponse($query, ['params' => $params]);
if (empty($response)) {
return false;
}
return $response;
}

}

0 comments on commit e389173

Please sign in to comment.