-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #13308: Improve getCustomAttribute() performance (by @schmengler)
- Loading branch information
Showing
16 changed files
with
463 additions
and
88 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
37 changes: 37 additions & 0 deletions
37
app/code/Magento/Catalog/Model/Entity/GetCategoryCustomAttributeCodes.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,37 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Catalog\Model\Entity; | ||
|
||
use Magento\Catalog\Api\Data\CategoryInterface; | ||
use Magento\Eav\Model\Entity\GetCustomAttributeCodesInterface; | ||
use Magento\Framework\Api\MetadataServiceInterface; | ||
|
||
class GetCategoryCustomAttributeCodes implements GetCustomAttributeCodesInterface | ||
{ | ||
/** | ||
* @var GetCustomAttributeCodesInterface | ||
*/ | ||
private $baseCustomAttributeCodes; | ||
|
||
/** | ||
* @param GetCustomAttributeCodesInterface $baseCustomAttributeCodes | ||
*/ | ||
public function __construct( | ||
GetCustomAttributeCodesInterface $baseCustomAttributeCodes | ||
) { | ||
$this->baseCustomAttributeCodes = $baseCustomAttributeCodes; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function execute(MetadataServiceInterface $metadataService): array | ||
{ | ||
$customAttributesCodes = $this->baseCustomAttributeCodes->execute($metadataService); | ||
return array_diff($customAttributesCodes, CategoryInterface::ATTRIBUTES); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
app/code/Magento/Catalog/Model/Entity/GetProductCustomAttributeCodes.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,37 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Catalog\Model\Entity; | ||
|
||
use Magento\Catalog\Api\Data\ProductInterface; | ||
use Magento\Eav\Model\Entity\GetCustomAttributeCodesInterface; | ||
use Magento\Framework\Api\MetadataServiceInterface; | ||
|
||
class GetProductCustomAttributeCodes implements GetCustomAttributeCodesInterface | ||
{ | ||
/** | ||
* @var GetCustomAttributeCodesInterface | ||
*/ | ||
private $baseCustomAttributeCodes; | ||
|
||
/** | ||
* @param GetCustomAttributeCodesInterface $baseCustomAttributeCodes | ||
*/ | ||
public function __construct( | ||
GetCustomAttributeCodesInterface $baseCustomAttributeCodes | ||
) { | ||
$this->baseCustomAttributeCodes = $baseCustomAttributeCodes; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function execute(MetadataServiceInterface $metadataService): array | ||
{ | ||
$customAttributesCodes = $this->baseCustomAttributeCodes->execute($metadataService); | ||
return array_diff($customAttributesCodes, ProductInterface::ATTRIBUTES); | ||
} | ||
} |
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.