Skip to content

Commit 45628b0

Browse files
authored
Merge pull request #23 from landofcoder/feature8
Feature8
2 parents c1cd81a + 909437c commit 45628b0

File tree

10 files changed

+320
-72
lines changed

10 files changed

+320
-72
lines changed

Api/Data/TagInterface.php

Lines changed: 95 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,105 @@ interface TagInterface
55
{
66

77
const TAG_ID = 'tag_id';
8-
const TAG_NAME = 'tag_name';
8+
const TAG_TITLE = 'tag_title';
9+
const TAG_IDENTIFIER = 'identifier';
10+
const TAG_DESCRIPTION = 'tag_description';
11+
const TAG_STATUS = 'status';
12+
/**
13+
* Get tagID
14+
*
15+
* @return int|null
16+
*/
917
public function getTagId();
10-
18+
/**
19+
* Set tagID
20+
*
21+
* @param int|null
22+
* @return $this
23+
*/
1124
public function setTagId($tagId);
12-
public function getTagName();
13-
public function setTagName($tagName);
25+
/**
26+
* Set tagTitle
27+
*
28+
* @return string|null
29+
*/
30+
public function getTagTitle();
31+
/**
32+
* Set tagTitle
33+
*
34+
* @param string|null
35+
* @return $this
36+
*/
37+
public function setTagTitle($tagTitle);
38+
/**
39+
* Set status
40+
*
41+
* @return bool|null
42+
*/
43+
public function getStatus();
44+
/**
45+
* Set status
46+
*
47+
* @param bool|null
48+
* @return $this
49+
*/
50+
public function setStatus($status);
51+
52+
/**
53+
* Set identifier
54+
*
55+
* @return string|null
56+
*/
57+
public function getIdentifier();
58+
/**
59+
* Set identifier
60+
*
61+
* @param string|null
62+
* @return $this
63+
*/
64+
public function setIdentifier($identifier);
65+
66+
/**
67+
* Set tag_description
68+
*
69+
* @return string|null
70+
*/
71+
public function getTagDescription();
72+
/**
73+
* Set tag_description
74+
*
75+
* @param string|null
76+
* @return $this
77+
*/
78+
public function setTagDescription($tagDescription);
1479

1580
/**
16-
* Retrieve existing extension attributes object or create a new one.
17-
* @return \Lof\ProductTags\Api\Data\TagExtensionInterface|null
81+
* Set StoreId
82+
*
83+
* @return int|null
84+
*/
85+
public function getStoreId();
86+
/**
87+
* Set storeId
88+
*
89+
* @param int|null
90+
* @return $this
91+
*/
92+
public function setStoreId($storeId);
93+
94+
/**
95+
* Set products
96+
*
97+
* @return string[]|null
98+
*/
99+
public function getProducts();
100+
/**
101+
* Set products
102+
*
103+
* @param string[]|null
104+
* @return $this
18105
*/
19-
// public function getExtensionAttributes();
106+
public function setProducts($products);
20107

21-
// /**
22-
// * Set an extension attributes object.
23-
// * @param \Lof\ProductTags\Api\Data\TagExtensionInterface $extensionAttributes
24-
// * @return $this
25-
// */
26-
// public function setExtensionAttributes(
27-
// \Lof\ProductTags\Api\Data\TagExtensionInterface $extensionAttributes
28-
// );
108+
29109
}

Api/ProductsManagementInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ interface ProductsManagementInterface
2828

2929
/**
3030
* GET for products api
31-
* @param string $param
32-
* @return string
31+
* @param string[] $param
32+
* @return string[]
3333
*/
3434
public function getProducts($param);
3535
}

Api/TagRepositoryInterface.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ interface TagRepositoryInterface
3434
* @return \Lof\ProductTags\Api\Data\TagInterface
3535
* @throws \Magento\Framework\Exception\LocalizedException
3636
*/
37-
public function save(
38-
\Lof\ProductTags\Api\Data\TagInterface $tag
39-
);
37+
public function save(\Lof\ProductTags\Api\Data\TagInterface $tag);
4038

4139
/**
4240
* Retrieve Tag
@@ -58,13 +56,11 @@ public function getList(
5856

5957
/**
6058
* Delete Tag
61-
* @param \Lof\ProductTags\Api\Data\TagInterface $tag
59+
* @param bool $tagId
6260
* @return bool true on success
6361
* @throws \Magento\Framework\Exception\LocalizedException
6462
*/
65-
public function delete(
66-
\Lof\ProductTags\Api\Data\TagInterface $tag
67-
);
63+
public function delete($tagId);
6864

6965
/**
7066
* Delete Tag by ID

Controller/Adminhtml/Tag/Save.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Magento\Framework\Stdlib\DateTime\Filter\Date;
1616

1717
/**
18-
* Save CMS Tag action.
18+
* Save Lof Tag action.
1919
*/
2020
class Save extends \Lof\ProductTags\Controller\Adminhtml\Tag implements HttpPostActionInterface
2121
{
@@ -51,7 +51,6 @@ public function execute()
5151

5252
/** @var \Lof\ProductTags\Model\Tag $model */
5353
$model = $this->TagFactory->create();
54-
5554
$id = $this->getRequest()->getParam('tag_id');
5655
if ($id) {
5756
try {

Model/Data/Tag.php

Lines changed: 90 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,49 +40,120 @@ public function getTagId()
4040
/**
4141
* Set tag_id
4242
* @param string $tagId
43-
* @return \Lof\ProductTags\Api\Data\TagInterface
43+
* @return $this
4444
*/
4545
public function setTagId($tagId)
4646
{
4747
return $this->setData(self::TAG_ID, $tagId);
4848
}
4949

5050
/**
51-
* Get tag_name
51+
* Get tag_title
5252
* @return string|null
5353
*/
54-
public function getTagName()
54+
public function getTagTitle()
5555
{
56-
return $this->_get(self::TAG_NAME);
56+
return $this->_get(self::TAG_TITLE);
5757
}
5858

5959
/**
60-
* Set tag_name
61-
* @param string $tagName
60+
* Set tag_title
61+
* @param string $tagTitle
6262
* @return \Lof\ProductTags\Api\Data\TagInterface
6363
*/
64-
public function setTagName($tagName)
64+
public function setTagTitle($tagTitle)
6565
{
66-
return $this->setData(self::TAG_NAME, $tagName);
66+
return $this->setData(self::TAG_TITLE, $tagTitle);
6767
}
6868

6969
/**
70-
* Retrieve existing extension attributes object or create a new one.
71-
* @return \Lof\ProductTags\Api\Data\TagExtensionInterface|null
70+
* Set status
71+
*
72+
* @return bool|null
7273
*/
73-
public function getExtensionAttributes()
74-
{
75-
return $this->_getExtensionAttributes();
74+
public function getStatus(){
75+
return $this->_get(self::TAG_STATUS);
76+
}
77+
/**
78+
* Set status
79+
*
80+
* @param bool|null
81+
* @return $this
82+
*/
83+
public function setStatus($status){
84+
return $this->setData(self::TAG_STATUS, $status);
85+
}
86+
87+
/**
88+
* Set identifier
89+
*
90+
* @return string|null
91+
*/
92+
public function getIdentifier(){
93+
return $this->_get(self::TAG_IDENTIFIER);
94+
}
95+
/**
96+
* Set identifier
97+
*
98+
* @param string|null
99+
* @return $this
100+
*/
101+
public function setIdentifier($identifier){
102+
return $this->setData(self::TAG_IDENTIFIER, $identifier);
103+
}
104+
105+
/**
106+
* Set tag_description
107+
*
108+
* @return string|null
109+
*/
110+
public function getTagDescription(){
111+
return $this->_get(self::TAG_DESCRIPTION);
112+
}
113+
/**
114+
* Set tag_description
115+
*
116+
* @param string|null
117+
* @return $this
118+
*/
119+
public function setTagDescription($tagDescription){
120+
return $this->setData(self::TAG_DESCRIPTION, $tagDescription);
121+
}
122+
123+
/**
124+
* Set StoreId
125+
*
126+
* @return int|null
127+
*/
128+
public function getStoreId(){
129+
return $this->_get("store_id");
130+
}
131+
/**
132+
* Set storeId
133+
*
134+
* @param int|null
135+
* @return $this
136+
*/
137+
public function setStoreId($storeId){
138+
return $this->setData("store_id", $storeId);
76139
}
77140

78141
/**
79-
* Set an extension attributes object.
80-
* @param \Lof\ProductTags\Api\Data\TagExtensionInterface $extensionAttributes
142+
* Set products
143+
*
144+
* @return string[]|null
145+
*/
146+
public function getProducts(){
147+
return $this->_get("products");
148+
}
149+
/**
150+
* Set products
151+
*
152+
* @param string[]|null
81153
* @return $this
82154
*/
83-
public function setExtensionAttributes(
84-
\Lof\ProductTags\Api\Data\TagExtensionInterface $extensionAttributes
85-
) {
86-
return $this->_setExtensionAttributes($extensionAttributes);
155+
public function setProducts($products){
156+
return $this->setData("products", $products);
87157
}
158+
88159
}

0 commit comments

Comments
 (0)