Skip to content

Commit d07039c

Browse files
committed
updated product tags module files
0 parents  commit d07039c

Some content is hidden

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

52 files changed

+1782
-0
lines changed

Api/Data/TagInterface.php

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2019 Landofcoder
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
namespace Lof\ProductTags\Api\Data;
25+
26+
interface TagInterface extends \Magento\Framework\Api\ExtensibleDataInterface
27+
{
28+
29+
const TAG_ID = 'tag_id';
30+
const TAG_NAME = 'tag_name';
31+
32+
/**
33+
* Get tag_id
34+
* @return string|null
35+
*/
36+
public function getTagId();
37+
38+
/**
39+
* Set tag_id
40+
* @param string $tagId
41+
* @return \Lof\ProductTags\Api\Data\TagInterface
42+
*/
43+
public function setTagId($tagId);
44+
45+
/**
46+
* Get tag_name
47+
* @return string|null
48+
*/
49+
public function getTagName();
50+
51+
/**
52+
* Set tag_name
53+
* @param string $tagName
54+
* @return \Lof\ProductTags\Api\Data\TagInterface
55+
*/
56+
public function setTagName($tagName);
57+
58+
/**
59+
* Retrieve existing extension attributes object or create a new one.
60+
* @return \Lof\ProductTags\Api\Data\TagExtensionInterface|null
61+
*/
62+
public function getExtensionAttributes();
63+
64+
/**
65+
* Set an extension attributes object.
66+
* @param \Lof\ProductTags\Api\Data\TagExtensionInterface $extensionAttributes
67+
* @return $this
68+
*/
69+
public function setExtensionAttributes(
70+
\Lof\ProductTags\Api\Data\TagExtensionInterface $extensionAttributes
71+
);
72+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2019 Landofcoder
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
namespace Lof\ProductTags\Api\Data;
25+
26+
interface TagSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
27+
{
28+
29+
/**
30+
* Get Tag list.
31+
* @return \Lof\ProductTags\Api\Data\TagInterface[]
32+
*/
33+
public function getItems();
34+
35+
/**
36+
* Set tag_name list.
37+
* @param \Lof\ProductTags\Api\Data\TagInterface[] $items
38+
* @return $this
39+
*/
40+
public function setItems(array $items);
41+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2019 Landofcoder
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
namespace Lof\ProductTags\Api;
25+
26+
interface ProductsManagementInterface
27+
{
28+
29+
/**
30+
* GET for products api
31+
* @param string $param
32+
* @return string
33+
*/
34+
public function getProducts($param);
35+
}

Api/TagRepositoryInterface.php

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2019 Landofcoder
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
namespace Lof\ProductTags\Api;
25+
26+
use Magento\Framework\Api\SearchCriteriaInterface;
27+
28+
interface TagRepositoryInterface
29+
{
30+
31+
/**
32+
* Save Tag
33+
* @param \Lof\ProductTags\Api\Data\TagInterface $tag
34+
* @return \Lof\ProductTags\Api\Data\TagInterface
35+
* @throws \Magento\Framework\Exception\LocalizedException
36+
*/
37+
public function save(
38+
\Lof\ProductTags\Api\Data\TagInterface $tag
39+
);
40+
41+
/**
42+
* Retrieve Tag
43+
* @param string $tagId
44+
* @return \Lof\ProductTags\Api\Data\TagInterface
45+
* @throws \Magento\Framework\Exception\LocalizedException
46+
*/
47+
public function getById($tagId);
48+
49+
/**
50+
* Retrieve Tag matching the specified criteria.
51+
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
52+
* @return \Lof\ProductTags\Api\Data\TagSearchResultsInterface
53+
* @throws \Magento\Framework\Exception\LocalizedException
54+
*/
55+
public function getList(
56+
\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
57+
);
58+
59+
/**
60+
* Delete Tag
61+
* @param \Lof\ProductTags\Api\Data\TagInterface $tag
62+
* @return bool true on success
63+
* @throws \Magento\Framework\Exception\LocalizedException
64+
*/
65+
public function delete(
66+
\Lof\ProductTags\Api\Data\TagInterface $tag
67+
);
68+
69+
/**
70+
* Delete Tag by ID
71+
* @param string $tagId
72+
* @return bool true on success
73+
* @throws \Magento\Framework\Exception\NoSuchEntityException
74+
* @throws \Magento\Framework\Exception\LocalizedException
75+
*/
76+
public function deleteById($tagId);
77+
}

Api/TagsManagementInterface.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2019 Landofcoder
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
namespace Lof\ProductTags\Api;
25+
26+
interface TagsManagementInterface
27+
{
28+
29+
/**
30+
* GET for tags api
31+
* @param string $param
32+
* @return string
33+
*/
34+
public function getTags($param);
35+
}

Block/Adminhtml/Tags/Index.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2019 Landofcoder
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
namespace Lof\ProductTags\Block\Adminhtml\Tags;
25+
26+
class Index extends \Magento\Backend\Block\Template
27+
{
28+
29+
/**
30+
* Constructor
31+
*
32+
* @param \Magento\Backend\Block\Template\Context $context
33+
* @param array $data
34+
*/
35+
public function __construct(
36+
\Magento\Backend\Block\Template\Context $context,
37+
array $data = []
38+
) {
39+
parent::__construct($context, $data);
40+
}
41+
}

Block/ListTags.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2019 Landofcoder
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
namespace Lof\ProductTags\Block;
25+
26+
class ListTags extends \Magento\Framework\View\Element\Template
27+
{
28+
29+
/**
30+
* Constructor
31+
*
32+
* @param \Magento\Framework\View\Element\Template\Context $context
33+
* @param array $data
34+
*/
35+
public function __construct(
36+
\Magento\Framework\View\Element\Template\Context $context,
37+
array $data = []
38+
) {
39+
parent::__construct($context, $data);
40+
}
41+
42+
/**
43+
* @return string
44+
*/
45+
public function getListTags()
46+
{
47+
//Your block code
48+
return __('Hello Developer! This how to get the storename: %1 and this is the way to build a url: %2', $this->_storeManager->getStore()->getName(), $this->getUrl('contacts'));
49+
}
50+
}

0 commit comments

Comments
 (0)