for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author @jayS-de <[email protected]>
*/
namespace Commercetools\Core\Request;
use Commercetools\Core\Model\Channel\ChannelReference;
use Commercetools\Core\Model\CustomerGroup\CustomerGroupReference;
use Commercetools\Core\Request\Query\Parameter;
use Commercetools\Core\Request\Query\ParameterInterface;
* @method $this addParamObject(ParameterInterface $param)
trait PriceSelectTrait
{
protected function select($key, $value)
if (!is_null($value)) {
$this->addParamObject(new Parameter($key, $value));
}
return $this;
* @param string $currency
* @return $this
public function currency($currency)
return $this->select('priceCurrency', $currency);
* @param string $country
public function country($country)
return $this->select('priceCountry', $country);
* @param ChannelReference $channel
public function channel(ChannelReference $channel)
return $this->select('priceChannel', $channel->getId());
* @param CustomerGroupReference $customerGroup
public function customerGroup(CustomerGroupReference $customerGroup)
return $this->select('priceCustomerGroup', $customerGroup->getId());