Pimcore\Db::cleanupBrokenViews PHP Метод

cleanupBrokenViews() публичный статический Метод

..) are still valid, if not, they're removed
public static cleanupBrokenViews ( )
    public static function cleanupBrokenViews()
    {
        $db = self::get();
        $tables = $db->fetchAll("SHOW FULL TABLES");
        foreach ($tables as $table) {
            reset($table);
            $name = current($table);
            $type = next($table);
            if ($type == "VIEW") {
                try {
                    $createStatement = $db->fetchRow("SHOW FIELDS FROM " . $name);
                } catch (\Exception $e) {
                    if (strpos($e->getMessage(), "references invalid table") !== false) {
                        Logger::err("view " . $name . " seems to be a broken one, it will be removed");
                        Logger::err("error message was: " . $e->getMessage());
                        $db->query("DROP VIEW " . $name);
                    } else {
                        Logger::error($e);
                    }
                }
            }
        }
    }