1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377:
<?php
/*
* This file is part of the affilinet Product Data PHP SDK.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Affilinet\ProductData\Requests;
use Affilinet\ProductData\AffilinetClient;
use Affilinet\ProductData\Exceptions\AffilinetProductWebserviceException;
use Affilinet\ProductData\Requests\Helper\QueryInterface;
use Affilinet\ProductData\Responses\ProductsResponseInterface;
use Affilinet\ProductData\Responses\ResponseElements\CategoryInterface;
use Affilinet\ProductData\Responses\ResponseElements\Product;
use Affilinet\ProductData\Responses\ResponseElements\ShopInterface;
/**
* Interface ProductsRequestInterface
*/
interface ProductsRequestInterface extends \Serializable, RequestInterface
{
const DEFAULT_FACET_VALUE_LIMIT = 20;
/**
* Find one Product by Id
*
* @param integer $productId
* @return Product
*/
public function findOne($productId);
/**
* @param array $productIds
* @return ProductsResponseInterface
*/
public function find(array $productIds);
/**
* @return AffilinetClient
*/
public function getAffilinetClient();
/**
* Exclude ShopIDs from result
*
* Please note the difference between ShopId and ProgramId:
* each program (= advertiser) has one ProgramId, but might have
* more than one ShopId, e.g. if the program supplies its
* electronics products separately from its clothing products.
* If one of the specified ShopIds is ‘0’, then the search is
* performed across all shops with which the requesting publisher
* has an accepted partners
*
*
* @param array $shopIDs
* @return ProductsRequest
*/
public function excludeShopIds(array $shopIDs);
/**
* @param array $shopIDs
* @return ProductsRequest
*/
public function onlyFromShopIds(array $shopIDs);
/**
* Filter results to these categories only
*
* @param array $categoryIds
* @param bool $excludeSubCategories
* @param bool $useAffilinetCategories Set to false if you want to use shop internal category IDs
* @return ProductsRequest
*/
public function onlyFromCategories(array $categoryIds, $excludeSubCategories = false, $useAffilinetCategories = true);
/**
* @param ShopInterface $shop
* @return $this
* @throws AffilinetProductWebserviceException
*/
public function onlyFromShop(ShopInterface $shop);
/**
* @param ShopInterface[] array
* @return $this
* @throws AffilinetProductWebserviceException
*/
public function onlyFromShops(array $shops);
/**
* @param CategoryInterface $category
* @return $this
*/
public function onlyFromShopCategory(CategoryInterface $category);
/**
* @param CategoryInterface[] $categories
* @return $this
*/
public function onlyFromShopCategories(array $categories);
/**
* Only results with an image
*
* If param $withImageOnly is set to false, all results are included
*
* @param bool $withImageOnly If set to false, all results will be included
* @return ProductsRequest
*/
public function onlyWithImage($withImageOnly = true);
/**
* Add the product image in OriginalSize
* @return ProductsRequest
*/
public function addProductImage();
/**
* Include a product ProductImage with 30px width
* @return ProductsRequest
*/
public function addProductImageWithSize30px();
/**
* Include a product ProductImage with 60px width
* @return ProductsRequest
*/
public function addProductImageWithSize60px();
/**
* Include a product ProductImage with 90px width
* @return ProductsRequest
*/
public function addProductImageWithSize90px();
/**
* Include a product ProductImage with 120px width
* @return ProductsRequest
*/
public function addProductImageWithSize120px();
/**
* Include a product ProductImage with 180px width
* @return ProductsRequest
*/
public function addProductImageWithSize180px();
/**
* Include the shop logo with 50px width
* @return ProductsRequest
*/
public function addShopLogoWithSize50px();
/**
* Include the shop logo with 90px width
* @return ProductsRequest
*/
public function addShopLogoWithSize90px();
/**
* Include the shop logo with 120px width
* @return ProductsRequest
*/
public function addShopLogoWithSize120px();
/**
* Include the shop logo with 150px width
* @return ProductsRequest
*/
public function addShopLogoWithSize150px();
/**
* Include the shop logo with 4680px width
* @return ProductsRequest
*/
public function addShopLogoWithSize468px();
/**
* Which page to display - starts counting at 1 - defaults to 1
*
* If you want to display the first page set $pageNumber to 1
* @param int $pageNumber
* @return ProductsRequest
*/
public function page($pageNumber = 1);
/**
* Number of products in one page
* minimum = 1, maximum = 500, default = 10
*
* If you want to display the first page set $pageNumber to 1
* @param int $pageNumber minimum = 1, maximum = 500, default = 10
* @return ProductsRequest
*/
public function pageSize($pageNumber = 1);
/**
* Result sorting. You can only sort by Score (==relevance), price, productName, lastShopUpdate
*
* Lets you define along which criteria the search results shall be sorted.
* Possible values are (case insensitive):
*
* - Score (a.k.a. rank, relevance)
* - Price (excl. shipping)
* - ProductName
* - LastImported (the date of the last feed update of this product’s shop is considered - not necessarily the last
* update of this singe product, but any product of this shop)
*
* By default, the results will be sorted by score. Products with the
* same score will be sorted by LastImported.
*
* @param $sortBy (Score, Price, ProductName, LastShopUpdate)
* @param bool $descending
* @return ProductsRequest
*/
public function sort($sortBy = 'Score', $descending = true);
/**
* Minimum product price
* @param $price float|int|string If string, no thousand separator and use a point (.) for decimal separator
* @return ProductsRequest
*/
public function minPrice($price);
/**
* Maximum product price
*
* @param $price float|int|string If string, no thousand separator and use a point (.) for decimal separator
* @return ProductsRequest
*/
public function maxPrice($price);
/**
* Add facet articleNumber
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetArticleNumber($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet brand
* A maximum of four facets can be added to the result
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetBrand($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet distributor
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetDistributor($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet EAN (European Article Number)
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetEAN($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet manufacturer
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetManufacturer($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet programId
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetProgramId($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet with shop IDs
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetShopId($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet with Shop Names
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetShopName($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet with Affilinet Category IDs
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetAffilinetCategoryId($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet with Affilinet Category Path
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetAffilinetCategoryPath($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet with Shop Category IDs
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetShopCategoryId($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Add facet with Shop Category Paths
* A maximum of four facets can be added to the result
*
* @param int $facetValueLimit
* @return ProductsRequest
*/
public function addFacetShopCategoryPath($facetValueLimit = self::DEFAULT_FACET_VALUE_LIMIT);
/**
* Serialize this request for use as URI query string
* @return string
*/
public function serialize();
/**
* Generate ProductsRequest from URI query string
*
* @param $serialized string
* @return ProductsRequest
*/
public function unserialize($serialized);
/**
* @param $query
* @return ProductsRequest
*/
public function addRawQuery($query);
/**
* @param QueryInterface $query
* @return ProductsRequestInterface;
*/
public function query(QueryInterface $query);
/**
* @param $name
* @param $value
* @return $this
*/
public function addFilterQuery($name, $value);
}