protected function getSortableObject(PersistentObjectProxy $objectProxy,
          PersistentObjectProxy $relativeProxy, RelationDescription $relationDesc) {
    // in a many to many relation, we have to modify the order of the relation objects
    if ($relationDesc instanceof RDBManyToManyRelationDescription) {
        $nmObjects = $this->loadRelationObjects($objectProxy, $relativeProxy, $relationDesc);
        return $nmObjects[0];
    }
    return $relativeProxy;
  }