| @@ 50-70 (lines=21) @@ | ||
| 47 | const VALID_UNTIL = 'validUntil'; |
|
| 48 | const REQUIRES_DISCOUNT_CODE = 'requiresDiscountCode'; |
|
| 49 | ||
| 50 | public function fieldDefinitions() |
|
| 51 | { |
|
| 52 | return [ |
|
| 53 | static::NAME => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString'], |
|
| 54 | static::DESCRIPTION => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString'], |
|
| 55 | static::VALUE => [static::TYPE => '\Commercetools\Core\Model\CartDiscount\CartDiscountValue'], |
|
| 56 | static::CART_PREDICATE => [static::TYPE => 'string'], |
|
| 57 | static::TARGET => [static::TYPE => '\Commercetools\Core\Model\CartDiscount\CartDiscountTarget'], |
|
| 58 | static::SORT_ORDER => [static::TYPE => 'string'], |
|
| 59 | static::IS_ACTIVE => [static::TYPE => 'bool'], |
|
| 60 | static::VALID_FROM => [ |
|
| 61 | static::TYPE => '\DateTime', |
|
| 62 | static::DECORATOR => '\Commercetools\Core\Model\Common\DateTimeDecorator' |
|
| 63 | ], |
|
| 64 | static::VALID_UNTIL => [ |
|
| 65 | static::TYPE => '\DateTime', |
|
| 66 | static::DECORATOR => '\Commercetools\Core\Model\Common\DateTimeDecorator' |
|
| 67 | ], |
|
| 68 | static::REQUIRES_DISCOUNT_CODE => [static::TYPE => 'bool'], |
|
| 69 | ]; |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * @param LocalizedString $name |
|
| @@ 50-70 (lines=21) @@ | ||
| 47 | const DISCOUNTED = 'discounted'; |
|
| 48 | const CUSTOM = 'custom'; |
|
| 49 | ||
| 50 | public function fieldDefinitions() |
|
| 51 | { |
|
| 52 | return [ |
|
| 53 | static::ID => [static::TYPE => 'string'], |
|
| 54 | static::VALUE => [self::TYPE => '\Commercetools\Core\Model\Common\Money'], |
|
| 55 | static::CURRENT_VALUE => [static::TYPE => '\Commercetools\Core\Model\Common\Money'], |
|
| 56 | static::COUNTRY => [self::TYPE => 'string'], |
|
| 57 | static::CUSTOMER_GROUP => [self::TYPE => '\Commercetools\Core\Model\CustomerGroup\CustomerGroupReference'], |
|
| 58 | static::CHANNEL => [self::TYPE => '\Commercetools\Core\Model\Channel\ChannelReference'], |
|
| 59 | static::VALID_FROM => [ |
|
| 60 | self::TYPE => '\DateTime', |
|
| 61 | self::DECORATOR => '\Commercetools\Core\Model\Common\DateTimeDecorator' |
|
| 62 | ], |
|
| 63 | static::VALID_UNTIL => [ |
|
| 64 | self::TYPE => '\DateTime', |
|
| 65 | self::DECORATOR => '\Commercetools\Core\Model\Common\DateTimeDecorator' |
|
| 66 | ], |
|
| 67 | static::DISCOUNTED => [self::TYPE => '\Commercetools\Core\Model\Common\DiscountedPrice'], |
|
| 68 | static::CUSTOM => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject'], |
|
| 69 | ]; |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * @param Money $money |
|