public function setSaveOrder($entity1, $entity2)
    {
        //lower priorty index means it's saved first (higher priorty)
        //so if $entity1 has lower priorty index (higher priority) than $entity2
        //then $entity1 is saved before $entity2

        //higher prioriry index means lower priority
        $lower_priority = max($this->_entities->getPriority($entity1), $this->_entities->getPriority($entity2));

        //lower priority index means higher priority
        $higher_priority = min($this->_entities->getPriority($entity1), $this->_entities->getPriority($entity2));

        $this->_entities->setPriority($entity1,  $higher_priority);
        $this->_entities->setPriority($entity2,  $lower_priority);
    }