Skip to content

Instantly share code, notes, and snippets.

@code-poel
Created January 22, 2016 16:58
Show Gist options
  • Save code-poel/e3a43cc2eabfe3364ff9 to your computer and use it in GitHub Desktop.
Save code-poel/e3a43cc2eabfe3364ff9 to your computer and use it in GitHub Desktop.
Check if an Mview index is up-to-date
<?php
// Check if an Mview index is up-to-date
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$sub = $connection->select()->from(['cl' => $table], ['version_id'])->order('version_id DESC')->limit(1);
$select = $connection->select()
->from(['m' => 'enterprise_mview_metadata'], ['version_id', 'latest_id' => $sub, 'status'])
->where('changelog_name = ?', $table)
->limit(1);
$status = $connection->fetchRow($select);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment