public function tableClass($table)
    {
        $tables = $this->getTableNames();
        $class = array_search($table, $tables, true);
        if ($class) {
            return $class;
        }

        // If there is no class for this table, strip table modifiers (e.g. _Live / _Versions)
        // from the end and re-attempt a search.
        if (preg_match('/^(?<class>.+)(_[^_]+)$/i', $table, $matches)) {
            $table = $matches['class'];
            $class = array_search($table, $tables, true);
            if ($class) {
                return $class;
            }
        }
        return null;
    }