Skip to content

Commit

Permalink
MAGETWO-70883: Prevent change log entry when nothing has changed #4893
Browse files Browse the repository at this point in the history
 - Coding Style fixes
  • Loading branch information
ishakhsuvarov committed Jul 21, 2017
1 parent e21bd31 commit 5b9888b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions app/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1330,4 +1330,11 @@
<argument name="configSource" xsi:type="object">Magento\Config\App\Config\Source\EnvironmentConfigSource</argument>
</arguments>
</type>
<type name="Magento\Framework\Mview\View\Subscription">
<arguments>
<argument name="ignoredUpdateColumns" xsi:type="array">
<item name="updated_at" xsi:type="string">updated_at</item>
</argument>
</arguments>
</type>
</config>
10 changes: 7 additions & 3 deletions lib/internal/Magento/Framework/Mview/View/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Ddl\Trigger;
use Magento\Framework\Mview\View\StateInterface;

class Subscription implements SubscriptionInterface
{
Expand Down Expand Up @@ -58,7 +59,7 @@ class Subscription implements SubscriptionInterface
*
* @var array
*/
protected $ignoredUpdateColumns = ['updated_at'];
private $ignoredUpdateColumns = [];

/**
* @var Resource
Expand All @@ -72,14 +73,16 @@ class Subscription implements SubscriptionInterface
* @param \Magento\Framework\Mview\ViewInterface $view
* @param string $tableName
* @param string $columnName
* @param array $ignoredUpdateColumns
*/
public function __construct(
ResourceConnection $resource,
\Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory,
\Magento\Framework\Mview\View\CollectionInterface $viewCollection,
\Magento\Framework\Mview\ViewInterface $view,
$tableName,
$columnName
$columnName,
$ignoredUpdateColumns = []
) {
$this->connection = $resource->getConnection();
$this->triggerFactory = $triggerFactory;
Expand All @@ -88,6 +91,7 @@ public function __construct(
$this->tableName = $tableName;
$this->columnName = $columnName;
$this->resource = $resource;
$this->ignoredUpdateColumns = $ignoredUpdateColumns;
}

/**
Expand Down Expand Up @@ -162,7 +166,7 @@ public function remove()
protected function getLinkedViews()
{
if (!$this->linkedViews) {
$viewList = $this->viewCollection->getViewsByStateMode(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED);
$viewList = $this->viewCollection->getViewsByStateMode(StateInterface::MODE_ENABLED);

foreach ($viewList as $view) {
/** @var \Magento\Framework\Mview\ViewInterface $view */
Expand Down

0 comments on commit 5b9888b

Please sign in to comment.