Skip to content

Commit 67e627b

Browse files
author
Yu Tang
committed
Merge branch 'FearlessKiwis-MAGETWO-32896-Sales-Immut-2' into develop
2 parents 55d63cc + 84b039c commit 67e627b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+8573
-682
lines changed

app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,93 @@
77

88
interface AgreementInterface
99
{
10+
/**#@+
11+
* Constants for keys of data array. Identical to the name of the getter in snake case
12+
*/
13+
const AGREEMENT_ID = 'agreement_id';
14+
const NAME = 'name';
15+
const CONTENT = 'content';
16+
const CONTENT_HEIGHT = 'content_height';
17+
const CHECKBOX_TEXT = 'checkbox_text';
18+
const IS_ACTIVE = 'is_active';
19+
const IS_HTML = 'is_html';
20+
/**#@-*/
21+
1022
/**
1123
* Returns the agreement ID.
1224
*
1325
* @return int Agreement ID.
1426
*/
1527
public function getAgreementId();
1628

29+
/**
30+
* Sets the agreement ID.
31+
*
32+
* @param int $id
33+
* @return $this
34+
*/
35+
public function setAgreementId($id);
36+
1737
/**
1838
* Returns the agreement name.
1939
*
2040
* @return string Agreement name.
2141
*/
2242
public function getName();
2343

44+
/**
45+
* Sets the agreement name.
46+
*
47+
* @param string $name
48+
* @return $this
49+
*/
50+
public function setName($name);
51+
2452
/**
2553
* Returns the agreement content.
2654
*
2755
* @return string Agreement content.
2856
*/
2957
public function getContent();
3058

59+
/**
60+
* Sets the agreement content.
61+
*
62+
* @param string $content
63+
* @return $this
64+
*/
65+
public function setContent($content);
66+
3167
/**
3268
* Returns the agreement content height, which is an optional CSS property.
3369
*
3470
* @return string|null Agreement content height. Otherwise, null.
3571
*/
3672
public function getContentHeight();
3773

74+
/**
75+
* Sets the agreement content height, which is an optional CSS property.
76+
*
77+
* @param string|null $height
78+
* @return $this
79+
*/
80+
public function setContentHeight($height);
81+
3882
/**
3983
* Returns the agreement checkbox text.
4084
*
4185
* @return string Agreement checkbox text.
4286
*/
4387
public function getCheckboxText();
4488

89+
/**
90+
* Sets the agreement checkbox text.
91+
*
92+
* @param string $text
93+
* @return $this
94+
*/
95+
public function setCheckboxText($text);
96+
4597
/**
4698
* Returns the agreement status.
4799
*
@@ -50,6 +102,14 @@ public function getCheckboxText();
50102
*/
51103
public function getIsActive();
52104

105+
/**
106+
* Sets the agreement status.
107+
*
108+
* @param bool $status
109+
* @return $this
110+
*/
111+
public function setIsActive($status);
112+
53113
/**
54114
* Returns the agreement content type.
55115
*
@@ -58,4 +118,14 @@ public function getIsActive();
58118
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
59119
*/
60120
public function getIsHtml();
121+
122+
/**
123+
* Sets the agreement content type.
124+
* * true - HTML
125+
* * false - plain text
126+
*
127+
* @param bool $isHtml
128+
* @return $this
129+
*/
130+
public function setIsHtml($isHtml);
61131
}

app/code/Magento/CheckoutAgreements/Model/Agreement.php

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,55 +70,111 @@ public function beforeSave()
7070
*/
7171
public function getAgreementId()
7272
{
73-
return $this->getData('agreement_id');
73+
return $this->getData(self::AGREEMENT_ID);
74+
}
75+
76+
/**
77+
* @inheritdoc
78+
*/
79+
public function setAgreementId($id)
80+
{
81+
return $this->setData(self::AGREEMENT_ID, $id);
7482
}
7583

7684
/**
7785
* @inheritdoc
7886
*/
7987
public function getName()
8088
{
81-
return $this->getData('name');
89+
return $this->getData(self::NAME);
90+
}
91+
92+
/**
93+
* @inheritdoc
94+
*/
95+
public function setName($name)
96+
{
97+
return $this->setData(self::NAME, $name);
8298
}
8399

84100
/**
85101
* @inheritdoc
86102
*/
87103
public function getContent()
88104
{
89-
return $this->getData('content');
105+
return $this->getData(self::CONTENT);
106+
}
107+
108+
/**
109+
* @inheritdoc
110+
*/
111+
public function setContent($content)
112+
{
113+
return $this->setData(self::CONTENT, $content);
90114
}
91115

92116
/**
93117
* @inheritdoc
94118
*/
95119
public function getContentHeight()
96120
{
97-
return $this->getData('content_height');
121+
return $this->getData(self::CONTENT_HEIGHT);
122+
}
123+
124+
/**
125+
* @inheritdoc
126+
*/
127+
public function setContentHeight($height)
128+
{
129+
return $this->setData(self::CONTENT_HEIGHT, $height);
98130
}
99131

100132
/**
101133
* @inheritdoc
102134
*/
103135
public function getCheckboxText()
104136
{
105-
return $this->getData('checkbox_text');
137+
return $this->getData(self::CHECKBOX_TEXT);
138+
}
139+
140+
/**
141+
* @inheritdoc
142+
*/
143+
public function setCheckboxText($text)
144+
{
145+
return $this->setData(self::CHECKBOX_TEXT, $text);
106146
}
107147

108148
/**
109149
* @inheritdoc
110150
*/
111151
public function getIsActive()
112152
{
113-
return $this->getData('is_active');
153+
return $this->getData(self::IS_ACTIVE);
154+
}
155+
156+
/**
157+
* @inheritdoc
158+
*/
159+
public function setIsActive($status)
160+
{
161+
return $this->setData(self::IS_ACTIVE, $status);
114162
}
115163

116164
/**
117165
* @inheritdoc
118166
*/
119167
public function getIsHtml()
120168
{
121-
return $this->getData('is_html');
169+
return $this->getData(self::IS_HTML);
170+
}
171+
172+
/**
173+
* @inheritdoc
174+
*/
175+
public function setIsHtml($isHtml)
176+
{
177+
return $this->setData(self::IS_HTML, $isHtml);
122178
}
123179
//@codeCoverageIgnoreEnd
124180
}

app/code/Magento/GiftMessage/Api/Data/MessageInterface.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,88 @@
77

88
interface MessageInterface extends \Magento\Framework\Api\ExtensibleDataInterface
99
{
10+
/**#@+
11+
* Constants for keys of data array. Identical to the name of the getter in snake case
12+
*/
13+
const GIFT_MESSAGE_ID = 'gift_message_id';
14+
const CUSTOMER_ID = 'customer_id';
15+
const SENDER = 'sender';
16+
const RECIPIENT = 'recipient';
17+
const MESSAGE = 'message';
18+
/**#@-*/
19+
1020
/**
1121
* Returns the gift message ID.
1222
*
1323
* @return int|null Gift message ID. Otherwise, null.
1424
*/
1525
public function getGiftMessageId();
1626

27+
/**
28+
* Sets the gift message ID.
29+
*
30+
* @param int|null $id
31+
* @return $this
32+
*/
33+
public function setGiftMessageId($id);
34+
1735
/**
1836
* Returns the customer ID.
1937
*
2038
* @return int|null Customer ID. Otherwise, null.
2139
*/
2240
public function getCustomerId();
2341

42+
/**
43+
* Sets the customer ID.
44+
*
45+
* @param int|null $id
46+
* @return $this
47+
*/
48+
public function setCustomerId($id);
49+
2450
/**
2551
* Returns the sender name.
2652
*
2753
* @return string Sender name.
2854
*/
2955
public function getSender();
3056

57+
/**
58+
* Sets the sender name.
59+
*
60+
* @param string $sender
61+
* @return $this
62+
*/
63+
public function setSender($sender);
64+
3165
/**
3266
* Returns the recipient name.
3367
*
3468
* @return string Recipient name.
3569
*/
3670
public function getRecipient();
3771

72+
/**
73+
* Gets the recipient name.
74+
*
75+
* @param string $recipient
76+
* @return $this
77+
*/
78+
public function setRecipient($recipient);
79+
3880
/**
3981
* Returns the message text.
4082
*
4183
* @return string Message text.
4284
*/
4385
public function getMessage();
86+
87+
/**
88+
* Sets the message text.
89+
*
90+
* @param string $message
91+
* @return $this
92+
*/
93+
public function setMessage($message);
4494
}

0 commit comments

Comments
 (0)