|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * @author @jayS-de <[email protected]> |
| 4 | + */ |
| 5 | + |
| 6 | +namespace Commercetools\Core\Model\TaxCategory; |
| 7 | + |
| 8 | +use Commercetools\Core\Model\Common\JsonObject; |
| 9 | + |
| 10 | +/** |
| 11 | + * @package Commercetools\Core\Model\TaxCategory |
| 12 | + * @link http://dev.commercetools.com/http-api-projects-carts.html#externaltaxratedraft |
| 13 | + * @method string getName() |
| 14 | + * @method ExternalTaxRateDraft setName(string $name = null) |
| 15 | + * @method float getAmount() |
| 16 | + * @method ExternalTaxRateDraft setAmount(float $amount = null) |
| 17 | + * @method string getCountry() |
| 18 | + * @method ExternalTaxRateDraft setCountry(string $country = null) |
| 19 | + * @method string getState() |
| 20 | + * @method ExternalTaxRateDraft setState(string $state = null) |
| 21 | + * @method SubRateCollection getSubRates() |
| 22 | + * @method ExternalTaxRateDraft setSubRates(SubRateCollection $subRates = null) |
| 23 | + */ |
| 24 | +class ExternalTaxRateDraft extends JsonObject |
| 25 | +{ |
| 26 | + public function fieldDefinitions() |
| 27 | + { |
| 28 | + return [ |
| 29 | + 'name' => [self::TYPE => 'string'], |
| 30 | + 'amount' => [self::TYPE => 'float'], |
| 31 | + 'country' => [self::TYPE => 'string'], |
| 32 | + 'state' => [self::TYPE => 'string'], |
| 33 | + 'subRates' => [static::TYPE => '\Commercetools\Core\Model\TaxCategory\SubRateCollection'] |
| 34 | + ]; |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * @param string $name |
| 39 | + * @param string $country |
| 40 | + * @param float $amount |
| 41 | + * @return ExternalTaxRateDraft |
| 42 | + */ |
| 43 | + public static function ofNameCountryAndAmount($name, $country, $amount) |
| 44 | + { |
| 45 | + return static::of()->setName($name)->setCountry($country)->setAmount($amount); |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * @param string $name |
| 50 | + * @param string $country |
| 51 | + * @param float $amount |
| 52 | + * @param SubRateCollection $subRates |
| 53 | + * @return ExternalTaxRateDraft |
| 54 | + */ |
| 55 | + public static function ofNameCountryAmountAndSubRates($name, $country, $amount, SubRateCollection $subRates) |
| 56 | + { |
| 57 | + return static::of()->setName($name)->setCountry($country)->setAmount($amount)->setSubRates($subRates); |
| 58 | + } |
| 59 | + |
| 60 | + /** |
| 61 | + * @param string $name |
| 62 | + * @param string $country |
| 63 | + * @param SubRateCollection $subRates |
| 64 | + * @return ExternalTaxRateDraft |
| 65 | + */ |
| 66 | + public static function ofNameCountryAndSubRates($name, $country, SubRateCollection $subRates) |
| 67 | + { |
| 68 | + return static::of()->setName($name)->setCountry($country)->setSubRates($subRates); |
| 69 | + } |
| 70 | +} |
0 commit comments