1: <?php
2: namespace Izberg\Resource;
3: use Izberg\Resource;
4:
5: class Feed extends Resource
6: {
7: 8: 9: 10: 11: 12:
13: public function getName()
14: {
15: return "merchant_catalog_feed";
16: }
17:
18: public function __construct()
19: {
20: parent::__construct();
21: }
22:
23: public function post($feed_url, $every, $period, $name, $source_type = "prestashop", $merchantapikey = '')
24: {
25: $merchant = new Merchant();
26: $merchant->getCurrent($merchantapikey);
27: if (!$merchant->id)
28: return false;
29: $merchant_uri = "/v1/merchant/".$merchant->id."/";
30: $data = array(
31: 'merchant'=>$merchant_uri,
32: 'every'=>$every,
33: 'period'=>$period,
34: 'name'=>$name,
35: 'source_type'=>$source_type,
36: 'feed_url'=>$feed_url
37: );
38: return parent::$Izberg->Call($this->getName()."/", "POST", $data, "Content-Type: application/json");
39: }
40:
41: }
42: