original_string: public function swapWith($object, ConnectionInterface $con = null)
      {
          if (null === $con) {
              $con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
          }
          $con->beginTransaction();
          try {
              $oldRank = $this->getPosition();
              $newRank = $object->getPosition();
  
              $this->setPosition($newRank);
              $object->setPosition($oldRank);
  
              $this->save($con);
              $object->save($con);
              $con->commit();
  
              return $this;
          } catch (Exception $e) {
              $con->rollback();
              throw $e;
          }
      }
code: public function swapWith($object, ConnectionInterface $con = null)
      {
          if (null === $con) {
              $con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
          }
          $con->beginTransaction();
          try {
              $oldRank = $this->getPosition();
              $newRank = $object->getPosition();
  
              $this->setPosition($newRank);
              $object->setPosition($oldRank);
  
              $this->save($con);
              $object->save($con);
              $con->commit();
  
              return $this;
          } catch (Exception $e) {
              $con->rollback();
              throw $e;
          }
      }
code_tokens: public function swapWith ( $ object , ConnectionInterface $ con = null ) { if ( null === $ con ) { $ con = Propel :: getServiceContainer ( ) -> getWriteConnection ( CustomerGroupTableMap :: DATABASE_NAME ) ; } $ con -> beginTransaction ( ) ; try { $ oldRank = $ this -> getPosition ( ) ; $ newRank = $ object -> getPosition ( ) ; $ this -> setPosition ( $ newRank ) ; $ object -> setPosition ( $ oldRank ) ; $ this -> save ( $ con ) ; $ object -> save ( $ con ) ; $ con -> commit ( ) ; return $ this ; } catch ( Exception $ e ) { $ con -> rollback ( ) ; throw $ e ; } }
docstring: Exchange the rank of the object with the one passed as argument, and saves both objects
  
  @param     ChildCustomerGroup $object
  @param     ConnectionInterface $con optional connection
  
  @return    ChildCustomerGroup the current object
  
  @throws Exception if the database cannot execute the two updates
docstring_tokens: Exchange the rank of the object with the one passed as argument and saves both objects