"Back"

Template Source: frontend/base/default/template/debug/models.phtml

<?php
$items 
$this->getItems();
Mage::helper('debug')->sortModelsByOccurences($items);
$collections $this->getCollections();
$queries $this->getQueries();
?>
<h4><?php echo $this->__('MODELS'?></h4>
<table>
    <thead>
        <tr>
            <th><?php echo $this->__('Resource Name'?></th>
            <th><?php echo $this->__('Model Class'?></th>
            <th><?php echo $this->__('Times Instantiated'?></th>
        </tr>
    </thead>
    <tbody>
        <?php $row 0?>
        <?php foreach( $items as $item ): ?>
            <tr class="<?php echo ( ($row 'djDebugOdd' 'djDebugEven')) ?>">
                <td><?php echo $item['resource_name'?></td>
                <td><?php echo $item['class'?></td>
                <td><?php echo $item['occurences'?></td>
            </tr>
            <?php $row++; ?>
        <?php endforeach ?>
    </tbody>
</table>

<h4><?php echo $this->__('COLLECTIONS'?></h4>
<table>
    <thead>
        <tr>
            <th><?php echo $this->__('Type'?></th>
            <th><?php echo $this->__('Class'?></th>
            <th><?php echo $this->__('SQL'?></th>
        </tr>
    </thead>
    <tbody>
        <?php $row 0?>
        <?php foreach( $collections as $item ): ?>
            <tr class="<?php echo ( ($row 'djDebugOdd' 'djDebugEven')) ?>">
                <td><?php echo $item['type'?></td>
                <td><?php echo $item['class'?></td>
                <td><?php echo $item['sql'?></td>
            </tr>
            <?php $row++; ?>
        <?php endforeach ?>
    </tbody>
</table>
<h4><?php echo $this->__('QUERIES'?></h4>
<?php if( $queries ): ?>
    <p><a class="toggleTemplate" href="<?php echo Mage::getUrl('debug/index/toggleSqlProfiler'?>">Disable SQL Profiler</a></p>
<table>
    <thead>
        <tr>
            <th><?php echo $this->__('Time'?></th>
            <th><?php echo $this->__('Action'?></th>
            <th><?php echo $this->__('Query'?></th>
        </tr>
    </thead>
    <tbody>
        <?php $row 0?>
        <?php foreach( $queries as $item ): ?>
            <tr class="<?php echo ( ($row 'djDebugOdd' 'djDebugEven')) ?>">
                <td>
                          <div class=""><?php echo sprintf("%.4f"$item->getElapsedSecs()) ?>&nbsp;s</div>
                </td>
                <td>
                    <?php if( $item->getQueryType() ==  Zend_Db_Profiler::SELECT ): ?>
                        <a class="remoteCall" href="<?php echo $this->getSqlSelectUrl($item?>">SELECT</a><br />
                        <a class="remoteCall" href="<?php echo $this->getSqlExplainUrl($item?>">EXPLAIN</a><br />
                    <?php endif; ?>
                </td>
                <td class="syntax">
                     <div class="djDebugSqlWrap">
                         <div class="djDebugSql"><?php echo $item->getQuery() ?>
                             <?php if( count($item->getQueryParams()) ): ?>
                                <br/><strong>Params:</strong> <?php echo implode(', '$item->getQueryParams()); ?>
                            <?php endif; ?>
                        </div>
                     </div>
                </td>
            </tr>
            <?php $row++; ?>
        <?php endforeach ?>
    </tbody>
</table>
<?php else: ?>
    <p>SQL Profiler is not enabled. <a class="toggleTemplate" href="<?php echo Mage::getUrl('debug/index/toggleSqlProfiler'?>">Enable SQL Profiler</a></p>
<?php endif; ?>