src/Versioned.php
protected function isTableVersioned($table)
    {
        $schema = DataObject::getSchema();
        $tableClass = $schema->tableClass($table);
        if (empty($tableClass)) {
            return false;
        }

        // Check that this class belongs to the same tree
        $baseClass = $schema->baseDataClass($this->owner);
        if (!is_a($tableClass, $baseClass, true)) {
            return false;
        }

        // Check that this isn't a derived table
        // (e.g. _Live, or a many_many table)
        $mainTable = $schema->tableName($tableClass);
        if ($mainTable !== $table) {
            return false;
        }

        return true;
    }
protected function isTableVersioned($table)
    {
        $schema = DataObject::getSchema();
        $tableClass = $schema->tableClass($table);
        if (empty($tableClass)) {
            return false;
        }

        // Check that this class belongs to the same tree
        $baseClass = $schema->baseDataClass($this->owner);
        if (!is_a($tableClass, $baseClass, true)) {
            return false;
        }

        // Check that this isn't a derived table
        // (e.g. _Live, or a many_many table)
        $mainTable = $schema->tableName($tableClass);
        if ($mainTable !== $table) {
            return false;
        }

        return true;
    }
protected function isTableVersioned ( $ table ) { $ schema = DataObject :: getSchema ( ) ; $ tableClass = $ schema -> tableClass ( $ table ) ; if ( empty ( $ tableClass ) ) { return false ; } // Check that this class belongs to the same tree $ baseClass = $ schema -> baseDataClass ( $ this -> owner ) ; if ( ! is_a ( $ tableClass , $ baseClass , true ) ) { return false ; } // Check that this isn't a derived table // (e.g. _Live, or a many_many table) $ mainTable = $ schema -> tableName ( $ tableClass ) ; if ( $ mainTable !== $ table ) { return false ; } return true ; }
Determine if the given versioned table is a part of the sub-tree of the current dataobject
This helps prevent rewriting of other tables that get joined in, in particular, many_many tables

@param string $table
@return bool True if this table should be versioned
Determine if the given versioned table is a part of the sub - tree of the current dataobject This helps prevent rewriting of other tables that get joined in in particular many_many tables