Skip to content
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

Updated sprintf usage; Simplified isset usage #21096

Merged
merged 2 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

use Magento\Framework\App\ResourceConnection;

/**
* Abstract action class for category flat indexers.
*/
class AbstractAction
{
/**
Expand Down Expand Up @@ -130,7 +133,7 @@ protected function getFlatTableStructure($tableName)
$table = $this->connection->newTable(
$tableName
)->setComment(
sprintf("Catalog Category Flat", $tableName)
'Catalog Category Flat'
);

//Adding columns
Expand Down Expand Up @@ -378,7 +381,7 @@ protected function getAttributeValues($entityIds, $storeId)
$linkField = $this->getCategoryMetadata()->getLinkField();
foreach ($attributesType as $type) {
foreach ($this->getAttributeTypeValues($type, $entityIds, $storeId) as $row) {
if (isset($row[$linkField]) && isset($row['attribute_id'])) {
if (isset($row[$linkField], $row['attribute_id'])) {
$attributeId = $row['attribute_id'];
if (isset($attributes[$attributeId])) {
$attributeCode = $attributes[$attributeId]['attribute_code'];
Expand Down Expand Up @@ -496,6 +499,8 @@ protected function getTableName($name)
}

/**
* Get category metadata instance.
*
* @return \Magento\Framework\EntityManager\EntityMetadata
*/
private function getCategoryMetadata()
Expand All @@ -509,6 +514,8 @@ private function getCategoryMetadata()
}

/**
* Get skip static columns instance.
*
* @return array
*/
private function getSkipStaticColumns()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use Magento\Framework\DB\Select;
use Magento\Store\Model\Store;

/**
* Provide Select object for retrieve product id with minimal price.
*/
class LinkedProductSelectBuilderByBasePrice implements LinkedProductSelectBuilderInterface
{
/**
Expand Down Expand Up @@ -69,7 +72,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function build($productId)
{
Expand All @@ -85,7 +88,7 @@ public function build($productId)
[]
)->joinInner(
[BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS => $productTable],
sprintf('%s.entity_id = link.child_id', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS, $linkField),
sprintf('%s.entity_id = link.child_id', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS),
['entity_id']
)->joinInner(
['t' => $priceAttribute->getBackendTable()],
Expand Down