Example #1
0
 /**
  * Retrieve table status
  *
  * @param string $tableName
  * @return Varien_Object
  */
 public function getTableStatus($tableName)
 {
     $row = $this->_write->showTableStatus($tableName);
     if ($row) {
         $statusObject = new Varien_Object();
         $statusObject->setIdFieldName('name');
         foreach ($row as $field => $value) {
             $statusObject->setData(strtolower($field), $value);
         }
         $cntRow = $this->_write->fetchRow($this->_write->select()->from($tableName, 'COUNT(1) as rows'));
         $statusObject->setRows($cntRow['rows']);
         return $statusObject;
     }
     return false;
 }
Example #2
0
 /**
  * Retrieve table status
  *
  * @param string $tableName
  * @return Varien_Object
  */
 public function getTableStatus($tableName)
 {
     $sql = $this->_read->quoteInto('SHOW TABLE STATUS LIKE ?', $tableName);
     $row = $this->_read->fetchRow($sql);
     if ($row) {
         $statusObject = new Varien_Object();
         $statusObject->setIdFieldName('name');
         foreach ($row as $field => $value) {
             $statusObject->setData(strtolower($field), $value);
         }
         $cntRow = $this->_read->fetchRow($this->_read->select()->from($tableName, 'COUNT(*) as rows'));
         $statusObject->setRows($cntRow['rows']);
         return $statusObject;
     }
     return false;
 }