src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php
public static function doInsert($values, PropelPDO $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(RolePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
        }

        if ($values instanceof Criteria) {
            $criteria = clone $values; // rename for clarity
        } else {
            $criteria = $values->buildCriteria(); // build Criteria from Role object
        }

        if ($criteria->containsKey(RolePeer::ID) && $criteria->keyContainsValue(RolePeer::ID) ) {
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.RolePeer::ID.')');
        }


        // Set the correct dbName
        $criteria->setDbName(RolePeer::DATABASE_NAME);

        try {
            // use transaction because $criteria could contain info
            // for more than one table (I guess, conceivably)
            $con->beginTransaction();
            $pk = BasePeer::doInsert($criteria, $con);
            $con->commit();
        } catch (Exception $e) {
            $con->rollBack();
            throw $e;
        }

        return $pk;
    }
public static function doInsert($values, PropelPDO $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(RolePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
        }

        if ($values instanceof Criteria) {
            $criteria = clone $values; // rename for clarity
        } else {
            $criteria = $values->buildCriteria(); // build Criteria from Role object
        }

        if ($criteria->containsKey(RolePeer::ID) && $criteria->keyContainsValue(RolePeer::ID) ) {
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.RolePeer::ID.')');
        }


        // Set the correct dbName
        $criteria->setDbName(RolePeer::DATABASE_NAME);

        try {
            // use transaction because $criteria could contain info
            // for more than one table (I guess, conceivably)
            $con->beginTransaction();
            $pk = BasePeer::doInsert($criteria, $con);
            $con->commit();
        } catch (Exception $e) {
            $con->rollBack();
            throw $e;
        }

        return $pk;
    }
public static function doInsert ( $ values , PropelPDO $ con = null ) { if ( $ con === null ) { $ con = Propel :: getConnection ( RolePeer :: DATABASE_NAME , Propel :: CONNECTION_WRITE ) ; } if ( $ values instanceof Criteria ) { $ criteria = clone $ values ; // rename for clarity } else { $ criteria = $ values -> buildCriteria ( ) ; // build Criteria from Role object } if ( $ criteria -> containsKey ( RolePeer :: ID ) && $ criteria -> keyContainsValue ( RolePeer :: ID ) ) { throw new PropelException ( 'Cannot insert a value for auto-increment primary key (' . RolePeer :: ID . ')' ) ; } // Set the correct dbName $ criteria -> setDbName ( RolePeer :: DATABASE_NAME ) ; try { // use transaction because $criteria could contain info // for more than one table (I guess, conceivably) $ con -> beginTransaction ( ) ; $ pk = BasePeer :: doInsert ( $ criteria , $ con ) ; $ con -> commit ( ) ; } catch ( Exception $ e ) { $ con -> rollBack ( ) ; throw $ e ; } return $ pk ; }
Performs an INSERT on the database, given a Role or Criteria object.

@param      mixed $values Criteria or Role object containing data that is used to create the INSERT statement.
@param      PropelPDO $con the PropelPDO connection to use
@return mixed           The new primary key.
@throws PropelException Any exceptions caught during processing will be
rethrown wrapped into a PropelException.
Performs an INSERT on the database given a Role or Criteria object .