Beispiel #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(sfAssetPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $objs = null;
        if (empty($pks)) {
            $objs = array();
        } else {
            $criteria = new Criteria(sfAssetPeer::DATABASE_NAME);
            $criteria->add(sfAssetPeer::ID, $pks, Criteria::IN);
            $objs = sfAssetPeer::doSelect($criteria, $con);
        }
        return $objs;
    }
}
// BasesfAssetPeer
// 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 sfAssetPeer class, because it is not defined yet.
// If you need to use overridden methods, you can add this code to the bottom of the sfAssetPeer class:
//
// Propel::getDatabaseMap(sfAssetPeer::DATABASE_NAME)->addTableBuilder(sfAssetPeer::TABLE_NAME, sfAssetPeer::getMapBuilder());
//
// Doing so will effectively overwrite the registration below.
Propel::getDatabaseMap(BasesfAssetPeer::DATABASE_NAME)->addTableBuilder(BasesfAssetPeer::TABLE_NAME, BasesfAssetPeer::getMapBuilder());
Beispiel #2
0
        }
        $criteria = new Criteria(sfAssetPeer::DATABASE_NAME);
        $criteria->add(sfAssetPeer::ID, $pk);
        $v = sfAssetPeer::doSelect($criteria, $con);
        return !empty($v) > 0 ? $v[0] : null;
    }
    public static function retrieveByPKs($pks, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(self::DATABASE_NAME);
        }
        $objs = null;
        if (empty($pks)) {
            $objs = array();
        } else {
            $criteria = new Criteria();
            $criteria->add(sfAssetPeer::ID, $pks, Criteria::IN);
            $objs = sfAssetPeer::doSelect($criteria, $con);
        }
        return $objs;
    }
}
if (Propel::isInit()) {
    try {
        BasesfAssetPeer::getMapBuilder();
    } catch (Exception $e) {
        Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
    }
} else {
    Propel::registerMapBuilder('plugins.sfAssetsLibraryPlugin.lib.model.map.sfAssetMapBuilder');
}