<?php


abstract class BaseTblpresentationPeer {

	
	const DATABASE_NAME = 'propel';

	
	const TABLE_NAME = 'tblpresentation';

	
	const CLASS_DEFAULT = 'lib.model.Tblpresentation';

	
	const NUM_COLUMNS = 20;

	
	const NUM_LAZY_LOAD_COLUMNS = 1;

	
	const PR_ID = 'tblpresentation.PR_ID';

	
	const PR_CATEGORY = 'tblpresentation.PR_CATEGORY';

	
	const PR_LESSON = 'tblpresentation.PR_LESSON';

	
	const PR_NAME = 'tblpresentation.PR_NAME';

	
	const PR_SOURCE = 'tblpresentation.PR_SOURCE';

	
	const PR_KEYWORD = 'tblpresentation.PR_KEYWORD';

	
	const PR_TYPE = 'tblpresentation.PR_TYPE';

	
	const PR_FILENAME = 'tblpresentation.PR_FILENAME';

	
	const PR_USER = 'tblpresentation.PR_USER';

	
	const PR_SLIDES = 'tblpresentation.PR_SLIDES';

	
	const PR_DATE = 'tblpresentation.PR_DATE';

	
	const PR_HIT = 'tblpresentation.PR_HIT';

	
	const PR_RATING = 'tblpresentation.PR_RATING';

	
	const PR_STATUS = 'tblpresentation.PR_STATUS';

	
	const PR_PLAYERNAME = 'tblpresentation.PR_PLAYERNAME';

	
	const PR_CONTENT = 'tblpresentation.PR_CONTENT';

	
	const PR_VIEW = 'tblpresentation.PR_VIEW';

	
	const PR_FILESIZE = 'tblpresentation.PR_FILESIZE';

	
	const PR_THUMBNAIL = 'tblpresentation.PR_THUMBNAIL';

	
	const PR_PRICE = 'tblpresentation.PR_PRICE';

	
	public static $instances = array();

	
	private static $mapBuilder = null;

	
	private static $fieldNames = array (
		BasePeer::TYPE_PHPNAME => array ('PrId', 'PrCategory', 'PrLesson', 'PrName', 'PrSource', 'PrKeyword', 'PrType', 'PrFilename', 'PrUser', 'PrSlides', 'PrDate', 'PrHit', 'PrRating', 'PrStatus', 'PrPlayername', 'PrContent', 'PrView', 'PrFilesize', 'PrThumbnail', 'PrPrice', ),
		BasePeer::TYPE_STUDLYPHPNAME => array ('prId', 'prCategory', 'prLesson', 'prName', 'prSource', 'prKeyword', 'prType', 'prFilename', 'prUser', 'prSlides', 'prDate', 'prHit', 'prRating', 'prStatus', 'prPlayername', 'prContent', 'prView', 'prFilesize', 'prThumbnail', 'prPrice', ),
		BasePeer::TYPE_COLNAME => array (self::PR_ID, self::PR_CATEGORY, self::PR_LESSON, self::PR_NAME, self::PR_SOURCE, self::PR_KEYWORD, self::PR_TYPE, self::PR_FILENAME, self::PR_USER, self::PR_SLIDES, self::PR_DATE, self::PR_HIT, self::PR_RATING, self::PR_STATUS, self::PR_PLAYERNAME, self::PR_CONTENT, self::PR_VIEW, self::PR_FILESIZE, self::PR_THUMBNAIL, self::PR_PRICE, ),
		BasePeer::TYPE_FIELDNAME => array ('pr_id', 'pr_category', 'pr_lesson', 'pr_name', 'pr_source', 'pr_keyword', 'pr_type', 'pr_filename', 'pr_user', 'pr_slides', 'pr_date', 'pr_hit', 'pr_rating', 'pr_status', 'pr_playername', 'pr_content', 'pr_view', 'pr_filesize', 'pr_thumbnail', 'pr_price', ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
	);

	
	private static $fieldKeys = array (
		BasePeer::TYPE_PHPNAME => array ('PrId' => 0, 'PrCategory' => 1, 'PrLesson' => 2, 'PrName' => 3, 'PrSource' => 4, 'PrKeyword' => 5, 'PrType' => 6, 'PrFilename' => 7, 'PrUser' => 8, 'PrSlides' => 9, 'PrDate' => 10, 'PrHit' => 11, 'PrRating' => 12, 'PrStatus' => 13, 'PrPlayername' => 14, 'PrContent' => 15, 'PrView' => 16, 'PrFilesize' => 17, 'PrThumbnail' => 18, 'PrPrice' => 19, ),
		BasePeer::TYPE_STUDLYPHPNAME => array ('prId' => 0, 'prCategory' => 1, 'prLesson' => 2, 'prName' => 3, 'prSource' => 4, 'prKeyword' => 5, 'prType' => 6, 'prFilename' => 7, 'prUser' => 8, 'prSlides' => 9, 'prDate' => 10, 'prHit' => 11, 'prRating' => 12, 'prStatus' => 13, 'prPlayername' => 14, 'prContent' => 15, 'prView' => 16, 'prFilesize' => 17, 'prThumbnail' => 18, 'prPrice' => 19, ),
		BasePeer::TYPE_COLNAME => array (self::PR_ID => 0, self::PR_CATEGORY => 1, self::PR_LESSON => 2, self::PR_NAME => 3, self::PR_SOURCE => 4, self::PR_KEYWORD => 5, self::PR_TYPE => 6, self::PR_FILENAME => 7, self::PR_USER => 8, self::PR_SLIDES => 9, self::PR_DATE => 10, self::PR_HIT => 11, self::PR_RATING => 12, self::PR_STATUS => 13, self::PR_PLAYERNAME => 14, self::PR_CONTENT => 15, self::PR_VIEW => 16, self::PR_FILESIZE => 17, self::PR_THUMBNAIL => 18, self::PR_PRICE => 19, ),
		BasePeer::TYPE_FIELDNAME => array ('pr_id' => 0, 'pr_category' => 1, 'pr_lesson' => 2, 'pr_name' => 3, 'pr_source' => 4, 'pr_keyword' => 5, 'pr_type' => 6, 'pr_filename' => 7, 'pr_user' => 8, 'pr_slides' => 9, 'pr_date' => 10, 'pr_hit' => 11, 'pr_rating' => 12, 'pr_status' => 13, 'pr_playername' => 14, 'pr_content' => 15, 'pr_view' => 16, 'pr_filesize' => 17, 'pr_thumbnail' => 18, 'pr_price' => 19, ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
	);

	
	public static function getMapBuilder()
	{
		if (self::$mapBuilder === null) {
			self::$mapBuilder = new TblpresentationMapBuilder();
		}
		return self::$mapBuilder;
	}
	
	static public function translateFieldName($name, $fromType, $toType)
	{
		$toNames = self::getFieldNames($toType);
		$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
		if ($key === null) {
			throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
		}
		return $toNames[$key];
	}

	

	static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
	{
		if (!array_key_exists($type, self::$fieldNames)) {
			throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
		}
		return self::$fieldNames[$type];
	}

	
	public static function alias($alias, $column)
	{
		return str_replace(TblpresentationPeer::TABLE_NAME.'.', $alias.'.', $column);
	}

	
	public static function addSelectColumns(Criteria $criteria)
	{

		$criteria->addSelectColumn(TblpresentationPeer::PR_ID);

		$criteria->addSelectColumn(TblpresentationPeer::PR_CATEGORY);

		$criteria->addSelectColumn(TblpresentationPeer::PR_LESSON);

		$criteria->addSelectColumn(TblpresentationPeer::PR_NAME);

		$criteria->addSelectColumn(TblpresentationPeer::PR_SOURCE);

		$criteria->addSelectColumn(TblpresentationPeer::PR_KEYWORD);

		$criteria->addSelectColumn(TblpresentationPeer::PR_TYPE);

		$criteria->addSelectColumn(TblpresentationPeer::PR_FILENAME);

		$criteria->addSelectColumn(TblpresentationPeer::PR_USER);

		$criteria->addSelectColumn(TblpresentationPeer::PR_SLIDES);

		$criteria->addSelectColumn(TblpresentationPeer::PR_DATE);

		$criteria->addSelectColumn(TblpresentationPeer::PR_HIT);

		$criteria->addSelectColumn(TblpresentationPeer::PR_RATING);

		$criteria->addSelectColumn(TblpresentationPeer::PR_STATUS);

		$criteria->addSelectColumn(TblpresentationPeer::PR_PLAYERNAME);

		$criteria->addSelectColumn(TblpresentationPeer::PR_VIEW);

		$criteria->addSelectColumn(TblpresentationPeer::PR_FILESIZE);

		$criteria->addSelectColumn(TblpresentationPeer::PR_THUMBNAIL);

		$criteria->addSelectColumn(TblpresentationPeer::PR_PRICE);

	}

	
	public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
	{
				$criteria = clone $criteria;

								$criteria->setPrimaryTableName(TblpresentationPeer::TABLE_NAME);

		if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->setDistinct();
		}

		if (!$criteria->hasSelectClause()) {
			TblpresentationPeer::addSelectColumns($criteria);
		}

		$criteria->clearOrderByColumns(); 		$criteria->setDbName(self::DATABASE_NAME); 
		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}
				$stmt = BasePeer::doCount($criteria, $con);

		if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$count = (int) $row[0];
		} else {
			$count = 0; 		}
		$stmt->closeCursor();
		return $count;
	}
	
	public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
	{
		$critcopy = clone $criteria;
		$critcopy->setLimit(1);
		$objects = TblpresentationPeer::doSelect($critcopy, $con);
		if ($objects) {
			return $objects[0];
		}
		return null;
	}
	
	public static function doSelect(Criteria $criteria, PropelPDO $con = null)
	{
		return TblpresentationPeer::populateObjects(TblpresentationPeer::doSelectStmt($criteria, $con));
	}
	
	public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

		if (!$criteria->hasSelectClause()) {
			$criteria = clone $criteria;
			TblpresentationPeer::addSelectColumns($criteria);
		}

				$criteria->setDbName(self::DATABASE_NAME);

				return BasePeer::doSelect($criteria, $con);
	}
	
	public static function addInstanceToPool(Tblpresentation $obj, $key = null)
	{
		if (Propel::isInstancePoolingEnabled()) {
			if ($key === null) {
				$key = (string) $obj->getPrId();
			} 			self::$instances[$key] = $obj;
		}
	}

	
	public static function removeInstanceFromPool($value)
	{
		if (Propel::isInstancePoolingEnabled() && $value !== null) {
			if (is_object($value) && $value instanceof Tblpresentation) {
				$key = (string) $value->getPrId();
			} elseif (is_scalar($value)) {
								$key = (string) $value;
			} else {
				$e = new PropelException("Invalid value passed to removeInstanceFromPool().  Expected primary key or Tblpresentation object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
				throw $e;
			}

			unset(self::$instances[$key]);
		}
	} 
	
	public static function getInstanceFromPool($key)
	{
		if (Propel::isInstancePoolingEnabled()) {
			if (isset(self::$instances[$key])) {
				return self::$instances[$key];
			}
		}
		return null; 	}
	
	
	public static function clearInstancePool()
	{
		self::$instances = array();
	}
	
	
	public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
	{
				if ($row[$startcol + 0] === null) {
			return null;
		}
		return (string) $row[$startcol + 0];
	}

	
	public static function populateObjects(PDOStatement $stmt)
	{
		$results = array();
	
				$cls = TblpresentationPeer::getOMClass();
		$cls = substr('.'.$cls, strrpos('.'.$cls, '.') + 1);
				while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$key = TblpresentationPeer::getPrimaryKeyHashFromRow($row, 0);
			if (null !== ($obj = TblpresentationPeer::getInstanceFromPool($key))) {
																$results[] = $obj;
			} else {
		
				$obj = new $cls();
				$obj->hydrate($row);
				$results[] = $obj;
				TblpresentationPeer::addInstanceToPool($obj, $key);
			} 		}
		$stmt->closeCursor();
		return $results;
	}

	
	public static function doCountJoinTbluser(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
				$criteria = clone $criteria;

								$criteria->setPrimaryTableName(TblpresentationPeer::TABLE_NAME);

		if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->setDistinct();
		}

		if (!$criteria->hasSelectClause()) {
			TblpresentationPeer::addSelectColumns($criteria);
		}
		
		$criteria->clearOrderByColumns(); 		
				$criteria->setDbName(self::DATABASE_NAME);

		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

		$criteria->addJoin(array(TblpresentationPeer::PR_USER,), array(TbluserPeer::US_ID,), $join_behavior);
		$stmt = BasePeer::doCount($criteria, $con);

		if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$count = (int) $row[0];
		} else {
			$count = 0; 		}
		$stmt->closeCursor();
		return $count;
	}


	
	public static function doSelectJoinTbluser(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		TblpresentationPeer::addSelectColumns($c);
		$startcol = (TblpresentationPeer::NUM_COLUMNS - TblpresentationPeer::NUM_LAZY_LOAD_COLUMNS);
		TbluserPeer::addSelectColumns($c);

		$c->addJoin(array(TblpresentationPeer::PR_USER,), array(TbluserPeer::US_ID,), $join_behavior);
		$stmt = BasePeer::doSelect($c, $con);
		$results = array();

		while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$key1 = TblpresentationPeer::getPrimaryKeyHashFromRow($row, 0);
			if (null !== ($obj1 = TblpresentationPeer::getInstanceFromPool($key1))) {
															} else {

				$omClass = TblpresentationPeer::getOMClass();

				$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);
				$obj1 = new $cls();
				$obj1->hydrate($row);
				TblpresentationPeer::addInstanceToPool($obj1, $key1);
			} 
			$key2 = TbluserPeer::getPrimaryKeyHashFromRow($row, $startcol);
			if ($key2 !== null) {
				$obj2 = TbluserPeer::getInstanceFromPool($key2);
				if (!$obj2) {

					$omClass = TbluserPeer::getOMClass();

					$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);
					$obj2 = new $cls();
					$obj2->hydrate($row, $startcol);
					TbluserPeer::addInstanceToPool($obj2, $key2);
				} 
								$obj2->addTblpresentation($obj1);

			} 
			$results[] = $obj1;
		}
		$stmt->closeCursor();
		return $results;
	}


	
	public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
				$criteria = clone $criteria;

								$criteria->setPrimaryTableName(TblpresentationPeer::TABLE_NAME);

		if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->setDistinct();
		}

		if (!$criteria->hasSelectClause()) {
			TblpresentationPeer::addSelectColumns($criteria);
		}
		
		$criteria->clearOrderByColumns(); 		
				$criteria->setDbName(self::DATABASE_NAME);

		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

		$criteria->addJoin(array(TblpresentationPeer::PR_USER,), array(TbluserPeer::US_ID,), $join_behavior);
		$stmt = BasePeer::doCount($criteria, $con);

		if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$count = (int) $row[0];
		} else {
			$count = 0; 		}
		$stmt->closeCursor();
		return $count;
	}

	
	public static function doSelectJoinAll(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		TblpresentationPeer::addSelectColumns($c);
		$startcol2 = (TblpresentationPeer::NUM_COLUMNS - TblpresentationPeer::NUM_LAZY_LOAD_COLUMNS);

		TbluserPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + (TbluserPeer::NUM_COLUMNS - TbluserPeer::NUM_LAZY_LOAD_COLUMNS);

		$c->addJoin(array(TblpresentationPeer::PR_USER,), array(TbluserPeer::US_ID,), $join_behavior);
		$stmt = BasePeer::doSelect($c, $con);
		$results = array();

		while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$key1 = TblpresentationPeer::getPrimaryKeyHashFromRow($row, 0);
			if (null !== ($obj1 = TblpresentationPeer::getInstanceFromPool($key1))) {
															} else {
				$omClass = TblpresentationPeer::getOMClass();

				$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);
				$obj1 = new $cls();
				$obj1->hydrate($row);
				TblpresentationPeer::addInstanceToPool($obj1, $key1);
			} 
			
			$key2 = TbluserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
			if ($key2 !== null) {
				$obj2 = TbluserPeer::getInstanceFromPool($key2);
				if (!$obj2) {

					$omClass = TbluserPeer::getOMClass();


					$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);
					$obj2 = new $cls();
					$obj2->hydrate($row, $startcol2);
					TbluserPeer::addInstanceToPool($obj2, $key2);
				} 
								$obj2->addTblpresentation($obj1);
			} 
			$results[] = $obj1;
		}
		$stmt->closeCursor();
		return $results;
	}

	
	public static function getTableMap()
	{
		return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
	}

	
	public static function getOMClass()
	{
		return TblpresentationPeer::CLASS_DEFAULT;
	}

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

		if ($values instanceof Criteria) {
			$criteria = clone $values; 		} else {
			$criteria = $values->buildCriteria(); 		}

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


				$criteria->setDbName(self::DATABASE_NAME);

		try {
									$con->beginTransaction();
			$pk = BasePeer::doInsert($criteria, $con);
			$con->commit();
		} catch(PropelException $e) {
			$con->rollBack();
			throw $e;
		}

		return $pk;
	}

	
	public static function doUpdate($values, PropelPDO $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}

		$selectCriteria = new Criteria(self::DATABASE_NAME);

		if ($values instanceof Criteria) {
			$criteria = clone $values; 
			$comparison = $criteria->getComparison(TblpresentationPeer::PR_ID);
			$selectCriteria->add(TblpresentationPeer::PR_ID, $criteria->remove(TblpresentationPeer::PR_ID), $comparison);

		} else { 			$criteria = $values->buildCriteria(); 			$selectCriteria = $values->buildPkeyCriteria(); 		}

				$criteria->setDbName(self::DATABASE_NAME);

		return BasePeer::doUpdate($selectCriteria, $criteria, $con);
	}

	
	public static function doDeleteAll($con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		$affectedRows = 0; 		try {
									$con->beginTransaction();
			$affectedRows += BasePeer::doDeleteAll(TblpresentationPeer::TABLE_NAME, $con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollBack();
			throw $e;
		}
	}

	
	 public static function doDelete($values, PropelPDO $con = null)
	 {
		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}

		if ($values instanceof Criteria) {
												TblpresentationPeer::clearInstancePool();

						$criteria = clone $values;
		} elseif ($values instanceof Tblpresentation) {
						TblpresentationPeer::removeInstanceFromPool($values);
						$criteria = $values->buildPkeyCriteria();
		} else {
			


			$criteria = new Criteria(self::DATABASE_NAME);
			$criteria->add(TblpresentationPeer::PR_ID, (array) $values, Criteria::IN);

			foreach ((array) $values as $singleval) {
								TblpresentationPeer::removeInstanceFromPool($singleval);
			}
		}

				$criteria->setDbName(self::DATABASE_NAME);

		$affectedRows = 0; 
		try {
									$con->beginTransaction();
			
			$affectedRows += BasePeer::doDelete($criteria, $con);

			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollBack();
			throw $e;
		}
	}

	
	public static function doValidate(Tblpresentation $obj, $cols = null)
	{
		$columns = array();

		if ($cols) {
			$dbMap = Propel::getDatabaseMap(TblpresentationPeer::DATABASE_NAME);
			$tableMap = $dbMap->getTable(TblpresentationPeer::TABLE_NAME);

			if (! is_array($cols)) {
				$cols = array($cols);
			}

			foreach ($cols as $colName) {
				if ($tableMap->containsColumn($colName)) {
					$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
					$columns[$colName] = $obj->$get();
				}
			}
		} else {

		}

		$res =  BasePeer::doValidate(TblpresentationPeer::DATABASE_NAME, TblpresentationPeer::TABLE_NAME, $columns);
    if ($res !== true) {
        $request = sfContext::getInstance()->getRequest();
        foreach ($res as $failed) {
            $col = TblpresentationPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
            $request->setError($col, $failed->getMessage());
        }
    }

    return $res;
	}

	
	public static function retrieveByPK($pk, PropelPDO $con = null)
	{

		if (null !== ($obj = TblpresentationPeer::getInstanceFromPool((string) $pk))) {
			return $obj;
		}

		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

		$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		$criteria->add(TblpresentationPeer::PR_ID, $pk);

		$v = TblpresentationPeer::doSelect($criteria, $con);

		return !empty($v) > 0 ? $v[0] : null;
	}

	
	public static function retrieveByPKs($pks, PropelPDO $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

		$objs = null;
		if (empty($pks)) {
			$objs = array();
		} else {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
			$criteria->add(TblpresentationPeer::PR_ID, $pks, Criteria::IN);
			$objs = TblpresentationPeer::doSelect($criteria, $con);
		}
		return $objs;
	}

} 

Propel::getDatabaseMap(BaseTblpresentationPeer::DATABASE_NAME)->addTableBuilder(BaseTblpresentationPeer::TABLE_NAME, BaseTblpresentationPeer::getMapBuilder());

