public function insertAtRank($rank, ConnectionInterface $con = null)
    {
        $maxRank = ChildCustomerGroupQuery::create()->getMaxRankArray($con);
        if ($rank < 1 || $rank > $maxRank + 1) {
            throw new PropelException('Invalid rank ' . $rank);
        }
        // move the object in the list, at the given rank
        $this->setPosition($rank);
        if ($rank != $maxRank + 1) {
            // Keep the list modification query for the save() transaction
            $this->sortableQueries []= array(
                'callable'  => array('\CustomerGroup\Model\CustomerGroupQuery', 'sortableShiftRank'),
                'arguments' => array(1, $rank, null, )
            );
        }

        return $this;
    }
public function insertAtRank($rank, ConnectionInterface $con = null)
    {
        $maxRank = ChildCustomerGroupQuery::create()->getMaxRankArray($con);
        if ($rank < 1 || $rank > $maxRank + 1) {
            throw new PropelException('Invalid rank ' . $rank);
        }
        // move the object in the list, at the given rank
        $this->setPosition($rank);
        if ($rank != $maxRank + 1) {
            // Keep the list modification query for the save() transaction
            $this->sortableQueries []= array(
                'callable'  => array('\CustomerGroup\Model\CustomerGroupQuery', 'sortableShiftRank'),
                'arguments' => array(1, $rank, null, )
            );
        }

        return $this;
    }
public function insertAtRank ( $ rank , ConnectionInterface $ con = null ) { $ maxRank = ChildCustomerGroupQuery :: create ( ) -> getMaxRankArray ( $ con ) ; if ( $ rank < 1 || $ rank > $ maxRank + 1 ) { throw new PropelException ( 'Invalid rank ' . $ rank ) ; } // move the object in the list, at the given rank $ this -> setPosition ( $ rank ) ; if ( $ rank != $ maxRank + 1 ) { // Keep the list modification query for the save() transaction $ this -> sortableQueries [ ] = array ( 'callable' => array ( '\CustomerGroup\Model\CustomerGroupQuery' , 'sortableShiftRank' ) , 'arguments' => array ( 1 , $ rank , null , ) ) ; } return $ this ; }
Insert at specified rank
The modifications are not persisted until the object is saved.

@param     integer    $rank rank value
@param     ConnectionInterface  $con      optional connection

@return    ChildCustomerGroup the current object

@throws    PropelException
Insert at specified rank The modifications are not persisted until the object is saved .