private function _getPrimaryKey($tableName) { $primaryKey = Db::getInstance()->query("SHOW KEYS FROM {$tableName} WHERE Key_name = 'PRIMARY'")->fetch(); if ($primaryKey) { return Arrays::getValue($primaryKey, 'Column_name'); } else { return ''; } }