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;
        }
    }
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;
        }
    }
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 ; } }
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
Exchange the rank of the object with the one passed as argument and saves both objects