コード例 #1
0
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(AttributeAvI18nTableMap::DATABASE_NAME);
        }
        if ($criteria instanceof Criteria) {
            $criteria = clone $criteria;
            // rename for clarity
        } else {
            $criteria = $criteria->buildCriteria();
            // build Criteria from AttributeAvI18n object
        }
        // Set the correct dbName
        $query = AttributeAvI18nQuery::create()->mergeWith($criteria);
        try {
            // use transaction because $criteria could contain info
            // for more than one table (I guess, conceivably)
            $con->beginTransaction();
            $pk = $query->doInsert($con);
            $con->commit();
        } catch (PropelException $e) {
            $con->rollBack();
            throw $e;
        }
        return $pk;
    }
}
// AttributeAvI18nTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
AttributeAvI18nTableMap::buildTableMap();