예제 #1
0
     * @param      PropelPDO $con the connection to use
     * @throws     PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     */
    public static function retrieveByPKs($pks, PropelPDO $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(EmpresaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $objs = null;
        if (empty($pks)) {
            $objs = array();
        } else {
            $criteria = new Criteria(EmpresaPeer::DATABASE_NAME);
            $criteria->add(EmpresaPeer::ID_EMPRESA, $pks, Criteria::IN);
            $objs = EmpresaPeer::doSelect($criteria, $con);
        }
        return $objs;
    }
}
// BaseEmpresaPeer
// This is the static code needed to register the MapBuilder for this table with the main Propel class.
//
// NOTE: This static code cannot call methods on the EmpresaPeer class, because it is not defined yet.
// If you need to use overridden methods, you can add this code to the bottom of the EmpresaPeer class:
//
// Propel::getDatabaseMap(EmpresaPeer::DATABASE_NAME)->addTableBuilder(EmpresaPeer::TABLE_NAME, EmpresaPeer::getMapBuilder());
//
// Doing so will effectively overwrite the registration below.
Propel::getDatabaseMap(BaseEmpresaPeer::DATABASE_NAME)->addTableBuilder(BaseEmpresaPeer::TABLE_NAME, BaseEmpresaPeer::getMapBuilder());