-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collect category listing #820
Merged
Merged
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
05210b1
Implement category export
dairbuirabass 980a89f
Fix category tagging
dairbuirabass e8f5e37
Remove reference to the old CategoryCollection
dairbuirabass 6460c7c
Update Category model path
dairbuirabass da4e05a
Update nosto/php-sdk to version 7.0.0
dairbuirabass 4712f98
Create category save observer
dairbuirabass 728832c
Merge remote-tracking branch 'origin/develop' into feature/collect-ca…
supercid f5a1416
Fix return type category
supercid 0d99d78
Merge remote-tracking branch 'origin/develop' into feature/collect-ca…
supercid ee7b636
Update php-sdk to 7.0
supercid 67d31d3
Update php-sdk to 7.0
supercid 68c3299
Update changelog
supercid 2a01af0
Fix type, remove getCategoryVisibleInMenu
supercid d39dec1
temp sdk-branch
supercid d84340e
Remove unused imports, pass correct id to setProductStoreId
supercid 7b17150
Fix return types, add types in CategoryCollectionBuilder
supercid ba44234
Update nosto SDK to 7.1.0
supercid 58dc139
Set category availabel for NostoCategory in builder
phonglynosto b5b6a1e
Add categoryString for NostoCategory in Builder
phonglynosto 8de0bfa
Use the branch dev-hotfix/fix-update-category
d82dba6
Merge remote-tracking branch 'origin/develop' into feature/collect-ca…
phonglynosto 82e350b
Merge remote-tracking branch 'origin/develop' into feature/collect-ca…
supercid 40d536e
Bump version
supercid fe2ae58
remove unused Model/ResourceModel/Magento/Category/Collection
supercid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2023, Nosto Solutions Ltd | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @author Nosto Solutions Ltd <[email protected]> | ||
* @copyright 2020 Nosto Solutions Ltd | ||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause | ||
* | ||
*/ | ||
|
||
namespace Nosto\Tagging\Controller\Export; | ||
|
||
use Magento\Framework\App\Action\Context; | ||
use Magento\Store\Model\Store; | ||
use Nosto\Model\AbstractCollection; | ||
use Nosto\Model\Category\CategoryCollection; | ||
use Nosto\NostoException; | ||
use Nosto\Tagging\Helper\Account as NostoHelperAccount; | ||
use Nosto\Tagging\Helper\Scope as NostoHelperScope; | ||
use Nosto\Tagging\Model\Category\CollectionBuilder; | ||
|
||
/** | ||
* Category export controller used to export category tree to Nosto. | ||
* This controller will be called by Nosto when a new account has been created | ||
* from the Magento backend. The controller is public, but the information is | ||
* encrypted with AES, and only Nosto can decrypt it. | ||
*/ | ||
class Category extends Base | ||
{ | ||
public const PARAM_PREVIEW = 'preview'; | ||
|
||
/** @var CollectionBuilder */ | ||
private CollectionBuilder $nostoCollectionBuilder; | ||
|
||
/** | ||
* @param Context $context | ||
* @param NostoHelperScope $nostoHelperScope | ||
* @param NostoHelperAccount $nostoHelperAccount | ||
* @param CollectionBuilder $collectionBuilder | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
NostoHelperScope $nostoHelperScope, | ||
NostoHelperAccount $nostoHelperAccount, | ||
CollectionBuilder $collectionBuilder | ||
) { | ||
parent::__construct($context, $nostoHelperScope, $nostoHelperAccount); | ||
$this->nostoCollectionBuilder = $collectionBuilder; | ||
} | ||
|
||
/** | ||
* @param Store $store | ||
* @param int $limit | ||
* @param int $offset | ||
* @return AbstractCollection|CategoryCollection | ||
* @throws NostoException | ||
*/ | ||
public function buildExportCollection(Store $store, int $limit = 100, int $offset = 0) | ||
{ | ||
return $this->nostoCollectionBuilder->buildMany($store, $limit, $offset); | ||
} | ||
|
||
/** | ||
* @param Store $store | ||
* @param $id | ||
* @return AbstractCollection|CategoryCollection | ||
* @throws NostoException | ||
*/ | ||
public function buildSingleExportCollection(Store $store, $id) | ||
{ | ||
return $this->nostoCollectionBuilder->buildSingle($store, $id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be called with https://magento245.dev.nos.to:8443/nosto/export/category?&limit=2&offset=0&___store=default