forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.4-develop' into patch-3
- Loading branch information
Showing
279 changed files
with
6,517 additions
and
1,830 deletions.
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
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
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
51 changes: 51 additions & 0 deletions
51
app/code/Magento/Catalog/Api/ProductAttributeIsFilterableManagementInterface.php
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,51 @@ | ||
<?php | ||
/************************************************************************ | ||
* | ||
* ADOBE CONFIDENTIAL | ||
* ___________________ | ||
* | ||
* Copyright 2014 Adobe | ||
* All Rights Reserved. | ||
* | ||
* NOTICE: All information contained herein is, and remains | ||
* the property of Adobe and its suppliers, if any. The intellectual | ||
* and technical concepts contained herein are proprietary to Adobe | ||
* and its suppliers and are protected by all applicable intellectual | ||
* property laws, including trade secret and copyright laws. | ||
* Dissemination of this information or reproduction of this material | ||
* is strictly forbidden unless prior written permission is obtained | ||
* from Adobe. | ||
* ************************************************************************ | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Api; | ||
|
||
/** | ||
* Intended to allow setting 'is_filterable' property for specific attribute as integer value via REST/SOAP API | ||
* | ||
* @api | ||
*/ | ||
interface ProductAttributeIsFilterableManagementInterface | ||
{ | ||
/** | ||
* Retrieve 'is_filterable' property for specific attribute as integer | ||
* | ||
* @param string $attributeCode | ||
* @return int | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
*/ | ||
public function get(string $attributeCode): int; | ||
|
||
/** | ||
* Set 'is_filterable' property for specific attribute as integer | ||
* | ||
* @param string $attributeCode | ||
* @param int $isFilterable | ||
* @return bool | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
* @throws \Magento\Framework\Exception\InputException | ||
* @throws \Magento\Framework\Exception\StateException | ||
*/ | ||
public function set(string $attributeCode, int $isFilterable): bool; | ||
} |
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
64 changes: 64 additions & 0 deletions
64
app/code/Magento/Catalog/Model/Product/Attribute/IsFilterableManagement.php
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,64 @@ | ||
<?php | ||
/************************************************************************ | ||
* | ||
* ADOBE CONFIDENTIAL | ||
* ___________________ | ||
* | ||
* Copyright 2014 Adobe | ||
* All Rights Reserved. | ||
* | ||
* NOTICE: All information contained herein is, and remains | ||
* the property of Adobe and its suppliers, if any. The intellectual | ||
* and technical concepts contained herein are proprietary to Adobe | ||
* and its suppliers and are protected by all applicable intellectual | ||
* property laws, including trade secret and copyright laws. | ||
* Dissemination of this information or reproduction of this material | ||
* is strictly forbidden unless prior written permission is obtained | ||
* from Adobe. | ||
* ************************************************************************ | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Model\Product\Attribute; | ||
|
||
use Magento\Catalog\Api\ProductAttributeIsFilterableManagementInterface; | ||
use Magento\Catalog\Api\ProductAttributeRepositoryInterface; | ||
|
||
class IsFilterableManagement implements ProductAttributeIsFilterableManagementInterface | ||
{ | ||
/** | ||
* @var ProductAttributeRepositoryInterface | ||
*/ | ||
private ProductAttributeRepositoryInterface $productAttributeRepository; | ||
|
||
/** | ||
* @param ProductAttributeRepositoryInterface $productAttributeRepository | ||
*/ | ||
public function __construct( | ||
ProductAttributeRepositoryInterface $productAttributeRepository | ||
) { | ||
$this->productAttributeRepository = $productAttributeRepository; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function get(string $attributeCode): int | ||
{ | ||
$attribute = $this->productAttributeRepository->get($attributeCode); | ||
|
||
return (int)$attribute->getIsFilterable(); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function set(string $attributeCode, int $isFilterable): bool | ||
{ | ||
$attribute = $this->productAttributeRepository->get($attributeCode); | ||
$attribute->setIsFilterable($isFilterable); | ||
$this->productAttributeRepository->save($attribute); | ||
|
||
return true; | ||
} | ||
} |
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.