Skip to content

Commit

Permalink
ENGCOM-4191: Updated sprintf usage; Simplified isset usage #21096
Browse files Browse the repository at this point in the history
  • Loading branch information
sidolov authored Feb 13, 2019
2 parents 3ca44d2 + 4598008 commit fcd118c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
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

0 comments on commit fcd118c

Please sign in to comment.