コード例 #1
0
ファイル: Db.php プロジェクト: pradeep-wagento/magento2
 /**
  * Retrieve table status
  *
  * @param string $tableName
  * @return \Magento\Framework\DataObject|bool
  */
 public function getTableStatus($tableName)
 {
     $row = $this->connection->showTableStatus($tableName);
     if ($row) {
         $statusObject = new \Magento\Framework\DataObject();
         foreach ($row as $field => $value) {
             $statusObject->setData(strtolower($field), $value);
         }
         $cntRow = $this->connection->fetchRow($this->connection->select()->from($tableName, 'COUNT(1) as rows'));
         $statusObject->setRows($cntRow['rows']);
         return $statusObject;
     }
     return false;
 }