protected static function _defineRelationships()
    {
        $className = get_called_class();
        $classes = class_parents($className);
        array_unshift($classes, $className);
        static::$_classRelationships[$className] = [];
        while ($class = array_pop($classes)) {
            if (!empty($class::$relationships)) {
                static::$_classRelationships[$className] = array_merge(static::$_classRelationships[$className], $class::$relationships);
            }
            if (static::isVersioned() && !empty($class::$versioningRelationships)) {
                static::$_classRelationships[$className] = array_merge(static::$_classRelationships[$className], $class::$versioningRelationships);
            }
        }
    }