public function getJointParent($model, $includeSelf = false)
    {
        if ( is_numeric($model) ) {
            $model = call_user_func("$this->ownerClassName::findOne", $model);
        }
        if ( $this->owner->{$this->parentIdField} == $model->{$this->parentIdField} ) {
            return $this->getParent();
        }
        $ownerParents = $this->owner->getParents($includeSelf)->all();
        $modelParents = $model->getParents($includeSelf)->all();
        $jointParent = false;
        foreach ( $ownerParents as $idx => $parent ) {
            if ( isset($modelParents[$idx]) && $parent->{$this->primaryKey} == $modelParents[$idx]->{$this->primaryKey} ) {
                $jointParent = $parent;
            } else {
                break;
            }
        }
        return $jointParent;
    }