Subversion Repositories SmartDukaan

Rev

Rev 13567 | Rev 13579 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13567 Rev 13570
Line 6... Line 6...
6
 * @property User $User
6
 * @property User $User
7
 */
7
 */
8
class Api extends AppModel {
8
class Api extends AppModel {
9
	var $useTable = false;
9
	var $useTable = false;
10
 
10
 
11
	public function getDeals($userId=2,$page=1) {
11
	public function getDeals($userId=null,$page=1) {
12
		$apihost = Configure::read('apihost');
12
		$apihost = Configure::read('apihost');
13
		$url = $apihost."store_products/index/$userId/page:$page";
13
		$url = $apihost."store_products/index/$userId/page:$page";
14
		// $params = array('client_id'=>$this->instagramconfig['client_id'],'client_secret'=>$this->instagramconfig['client_secret'],'grant_type'=>$this->instagramconfig['grant_type'],'redirect_uri'=>$this->instagramconfig['redirect_uri']);
14
		// $params = array('client_id'=>$this->instagramconfig['client_id'],'client_secret'=>$this->instagramconfig['client_secret'],'grant_type'=>$this->instagramconfig['grant_type'],'redirect_uri'=>$this->instagramconfig['redirect_uri']);
15
		return $this->make_request($url,null);
15
		return $this->make_request($url,null);
16
	}
16
	}
17
	
17
	
18
	public function getDealsByCategory($userId=2,$categoryId=1,$page=1) {
18
	public function getDealsByCategory($userId=null,$categoryId=1,$page=1) {
19
		$apihost = Configure::read('apihost');
19
		$apihost = Configure::read('apihost');
20
		$url = $apihost."store_products/bycategory/$userId/page:$page";
20
		$url = $apihost."store_products/bycategory/$userId/page:$page";
21
		// $params = array('client_id'=>$this->instagramconfig['client_id'],'client_secret'=>$this->instagramconfig['client_secret'],'grant_type'=>$this->instagramconfig['grant_type'],'redirect_uri'=>$this->instagramconfig['redirect_uri']);
21
		// $params = array('client_id'=>$this->instagramconfig['client_id'],'client_secret'=>$this->instagramconfig['client_secret'],'grant_type'=>$this->instagramconfig['grant_type'],'redirect_uri'=>$this->instagramconfig['redirect_uri']);
22
		return $this->make_request($url,null);
22
		return $this->make_request($url,null);
23
	}
23
	}