<?php


abstract class BaseTblpresentation extends BaseObject  implements Persistent {


	
	protected static $peer;

	
	protected $pr_id;

	
	protected $pr_category;

	
	protected $pr_lesson;

	
	protected $pr_name;

	
	protected $pr_source;

	
	protected $pr_keyword;

	
	protected $pr_type;

	
	protected $pr_filename;

	
	protected $pr_user;

	
	protected $pr_slides;

	
	protected $pr_date;

	
	protected $pr_hit;

	
	protected $pr_rating;

	
	protected $pr_status;

	
	protected $pr_playername;

	
	protected $pr_content;

	
	protected $pr_content_isLoaded = false;

	
	protected $pr_view;

	
	protected $pr_filesize;

	
	protected $pr_thumbnail;

	
	protected $pr_price;

	
	protected $aTbluser;

	
	protected $collTblblogcategoryentrys;

	
	private $lastTblblogcategoryentryCriteria = null;

	
	protected $collTblblogentrys;

	
	private $lastTblblogentryCriteria = null;

	
	protected $collTbluserpresentations;

	
	private $lastTbluserpresentationCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function __construct()
	{
		parent::__construct();
		$this->applyDefaultValues();
	}

	
	public function applyDefaultValues()
	{
		$this->pr_slides = 0;
		$this->pr_hit = 0;
		$this->pr_rating = 0;
		$this->pr_status = 0;
		$this->pr_view = 0;
		$this->pr_filesize = 0;
		$this->pr_thumbnail = 0;
		$this->pr_price = 0;
	}

	
	public function getPrId()
	{
		return $this->pr_id;
	}

	
	public function getPrCategory()
	{
		return $this->pr_category;
	}

	
	public function getPrLesson()
	{
		return $this->pr_lesson;
	}

	
	public function getPrName()
	{
		return $this->pr_name;
	}

	
	public function getPrSource()
	{
		return $this->pr_source;
	}

	
	public function getPrKeyword()
	{
		return $this->pr_keyword;
	}

	
	public function getPrType()
	{
		return $this->pr_type;
	}

	
	public function getPrFilename()
	{
		return $this->pr_filename;
	}

	
	public function getPrUser()
	{
		return $this->pr_user;
	}

	
	public function getPrSlides()
	{
		return $this->pr_slides;
	}

	
	public function getPrDate($format = 'Y-m-d H:i:s')
	{
		if ($this->pr_date === null) {
			return null;
		}


		if ($this->pr_date === '0000-00-00 00:00:00') {
									return null;
		} else {
			try {
				$dt = new DateTime($this->pr_date);
			} catch (Exception $x) {
				throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->pr_date, true), $x);
			}
		}

		if ($format === null) {
						return $dt;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $dt->format('U'));
		} else {
			return $dt->format($format);
		}
	}

	
	public function getPrHit()
	{
		return $this->pr_hit;
	}

	
	public function getPrRating()
	{
		return $this->pr_rating;
	}

	
	public function getPrStatus()
	{
		return $this->pr_status;
	}

	
	public function getPrPlayername()
	{
		return $this->pr_playername;
	}

	
	public function getPrContent(PropelPDO $con = null)
	{
		if (!$this->pr_content_isLoaded && $this->pr_content === null && !$this->isNew()) {
			$this->loadPrContent($con);
		}

		return $this->pr_content;
	}

	
	protected function loadPrContent(PropelPDO $con = null)
	{
		$c = $this->buildPkeyCriteria();
		$c->addSelectColumn(TblpresentationPeer::PR_CONTENT);
		try {
			$stmt = TblpresentationPeer::doSelectStmt($c, $con);
			$row = $stmt->fetch(PDO::FETCH_NUM);
			$stmt->closeCursor();
			$this->pr_content = ($row[0] !== null) ? (string) $row[0] : null;
			$this->pr_content_isLoaded = true;
		} catch (Exception $e) {
			throw new PropelException("Error loading value for [pr_content] column on demand.", $e);
		}
	}
	
	public function getPrView()
	{
		return $this->pr_view;
	}

	
	public function getPrFilesize()
	{
		return $this->pr_filesize;
	}

	
	public function getPrThumbnail()
	{
		return $this->pr_thumbnail;
	}

	
	public function getPrPrice()
	{
		return $this->pr_price;
	}

	
	public function setPrId($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_id !== $v) {
			$this->pr_id = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_ID;
		}

		return $this;
	} 
	
	public function setPrCategory($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_category !== $v) {
			$this->pr_category = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_CATEGORY;
		}

		return $this;
	} 
	
	public function setPrLesson($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_lesson !== $v) {
			$this->pr_lesson = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_LESSON;
		}

		return $this;
	} 
	
	public function setPrName($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->pr_name !== $v) {
			$this->pr_name = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_NAME;
		}

		return $this;
	} 
	
	public function setPrSource($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->pr_source !== $v) {
			$this->pr_source = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_SOURCE;
		}

		return $this;
	} 
	
	public function setPrKeyword($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->pr_keyword !== $v) {
			$this->pr_keyword = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_KEYWORD;
		}

		return $this;
	} 
	
	public function setPrType($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->pr_type !== $v) {
			$this->pr_type = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_TYPE;
		}

		return $this;
	} 
	
	public function setPrFilename($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->pr_filename !== $v) {
			$this->pr_filename = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_FILENAME;
		}

		return $this;
	} 
	
	public function setPrUser($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_user !== $v) {
			$this->pr_user = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_USER;
		}

		if ($this->aTbluser !== null && $this->aTbluser->getUsId() !== $v) {
			$this->aTbluser = null;
		}

		return $this;
	} 
	
	public function setPrSlides($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_slides !== $v || $v === 0) {
			$this->pr_slides = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_SLIDES;
		}

		return $this;
	} 
	
	public function setPrDate($v)
	{
						if ($v === null || $v === '') {
			$dt = null;
		} elseif ($v instanceof DateTime) {
			$dt = $v;
		} else {
									try {
				if (is_numeric($v)) { 					$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
															$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
				} else {
					$dt = new DateTime($v);
				}
			} catch (Exception $x) {
				throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
			}
		}

		if ( $this->pr_date !== null || $dt !== null ) {
			
			$currNorm = ($this->pr_date !== null && $tmpDt = new DateTime($this->pr_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;
			$newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;

			if ( ($currNorm !== $newNorm) 					)
			{
				$this->pr_date = ($dt ? $dt->format('Y-m-d H:i:s') : null);
				$this->modifiedColumns[] = TblpresentationPeer::PR_DATE;
			}
		} 
		return $this;
	} 
	
	public function setPrHit($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_hit !== $v || $v === 0) {
			$this->pr_hit = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_HIT;
		}

		return $this;
	} 
	
	public function setPrRating($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_rating !== $v || $v === 0) {
			$this->pr_rating = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_RATING;
		}

		return $this;
	} 
	
	public function setPrStatus($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_status !== $v || $v === 0) {
			$this->pr_status = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_STATUS;
		}

		return $this;
	} 
	
	public function setPrPlayername($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->pr_playername !== $v) {
			$this->pr_playername = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_PLAYERNAME;
		}

		return $this;
	} 
	
	public function setPrContent($v)
	{
										$this->pr_content_isLoaded = true;

		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->pr_content !== $v) {
			$this->pr_content = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_CONTENT;
		}

		return $this;
	} 
	
	public function setPrView($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_view !== $v || $v === 0) {
			$this->pr_view = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_VIEW;
		}

		return $this;
	} 
	
	public function setPrFilesize($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_filesize !== $v || $v === 0) {
			$this->pr_filesize = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_FILESIZE;
		}

		return $this;
	} 
	
	public function setPrThumbnail($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_thumbnail !== $v || $v === 0) {
			$this->pr_thumbnail = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_THUMBNAIL;
		}

		return $this;
	} 
	
	public function setPrPrice($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->pr_price !== $v || $v === 0) {
			$this->pr_price = $v;
			$this->modifiedColumns[] = TblpresentationPeer::PR_PRICE;
		}

		return $this;
	} 
	
	public function hasOnlyDefaultValues()
	{
						if (array_diff($this->modifiedColumns, array(TblpresentationPeer::PR_SLIDES,TblpresentationPeer::PR_HIT,TblpresentationPeer::PR_RATING,TblpresentationPeer::PR_STATUS,TblpresentationPeer::PR_VIEW,TblpresentationPeer::PR_FILESIZE,TblpresentationPeer::PR_THUMBNAIL,TblpresentationPeer::PR_PRICE))) {
				return false;
			}

			if ($this->pr_slides !== 0) {
				return false;
			}

			if ($this->pr_hit !== 0) {
				return false;
			}

			if ($this->pr_rating !== 0) {
				return false;
			}

			if ($this->pr_status !== 0) {
				return false;
			}

			if ($this->pr_view !== 0) {
				return false;
			}

			if ($this->pr_filesize !== 0) {
				return false;
			}

			if ($this->pr_thumbnail !== 0) {
				return false;
			}

			if ($this->pr_price !== 0) {
				return false;
			}

				return true;
	} 
	
	public function hydrate($row, $startcol = 0, $rehydrate = false)
	{
		try {

			$this->pr_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
			$this->pr_category = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
			$this->pr_lesson = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
			$this->pr_name = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
			$this->pr_source = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
			$this->pr_keyword = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
			$this->pr_type = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
			$this->pr_filename = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
			$this->pr_user = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
			$this->pr_slides = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null;
			$this->pr_date = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
			$this->pr_hit = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null;
			$this->pr_rating = ($row[$startcol + 12] !== null) ? (int) $row[$startcol + 12] : null;
			$this->pr_status = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
			$this->pr_playername = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
			$this->pr_view = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null;
			$this->pr_filesize = ($row[$startcol + 16] !== null) ? (int) $row[$startcol + 16] : null;
			$this->pr_thumbnail = ($row[$startcol + 17] !== null) ? (int) $row[$startcol + 17] : null;
			$this->pr_price = ($row[$startcol + 18] !== null) ? (int) $row[$startcol + 18] : null;
			$this->resetModified();

			$this->setNew(false);

			if ($rehydrate) {
				$this->ensureConsistency();
			}

						return $startcol + 19; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Tblpresentation object", $e);
		}
	}

	
	public function ensureConsistency()
	{

		if ($this->aTbluser !== null && $this->pr_user !== $this->aTbluser->getUsId()) {
			$this->aTbluser = null;
		}
	} 
	
	public function reload($deep = false, PropelPDO $con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("Cannot reload a deleted object.");
		}

		if ($this->isNew()) {
			throw new PropelException("Cannot reload an unsaved object.");
		}

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

				
		$stmt = TblpresentationPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
		$row = $stmt->fetch(PDO::FETCH_NUM);
		$stmt->closeCursor();
		if (!$row) {
			throw new PropelException('Cannot find matching row in the database to reload object values.');
		}
		$this->hydrate($row, 0, true); 
				$this->pr_content = null;
		$this->pr_content_isLoaded = false;

		if ($deep) {  
			$this->aTbluser = null;
			$this->collTblblogcategoryentrys = null;
			$this->lastTblblogcategoryentryCriteria = null;

			$this->collTblblogentrys = null;
			$this->lastTblblogentryCriteria = null;

			$this->collTbluserpresentations = null;
			$this->lastTbluserpresentationCriteria = null;

		} 	}

	
	public function delete(PropelPDO $con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		
		$con->beginTransaction();
		try {
			TblpresentationPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollBack();
			throw $e;
		}
	}

	
	public function save(PropelPDO $con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(TblpresentationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		
		$con->beginTransaction();
		try {
			$affectedRows = $this->doSave($con);
			$con->commit();
			TblpresentationPeer::addInstanceToPool($this);
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollBack();
			throw $e;
		}
	}

	
	protected function doSave(PropelPDO $con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;

												
			if ($this->aTbluser !== null) {
				if ($this->aTbluser->isModified() || $this->aTbluser->isNew()) {
					$affectedRows += $this->aTbluser->save($con);
				}
				$this->setTbluser($this->aTbluser);
			}

			if ($this->isNew() ) {
				$this->modifiedColumns[] = TblpresentationPeer::PR_ID;
			}

						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = TblpresentationPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setPrId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += TblpresentationPeer::doUpdate($this, $con);
				}

				$this->resetModified(); 			}

			if ($this->collTblblogcategoryentrys !== null) {
				foreach ($this->collTblblogcategoryentrys as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTblblogentrys !== null) {
				foreach ($this->collTblblogentrys as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTbluserpresentations !== null) {
				foreach ($this->collTbluserpresentations as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			$this->alreadyInSave = false;

		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aTbluser !== null) {
				if (!$this->aTbluser->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aTbluser->getValidationFailures());
				}
			}


			if (($retval = TblpresentationPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


				if ($this->collTblblogcategoryentrys !== null) {
					foreach ($this->collTblblogcategoryentrys as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTblblogentrys !== null) {
					foreach ($this->collTblblogentrys as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTbluserpresentations !== null) {
					foreach ($this->collTbluserpresentations as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}


			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = TblpresentationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		$field = $this->getByPosition($pos);
		return $field;
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getPrId();
				break;
			case 1:
				return $this->getPrCategory();
				break;
			case 2:
				return $this->getPrLesson();
				break;
			case 3:
				return $this->getPrName();
				break;
			case 4:
				return $this->getPrSource();
				break;
			case 5:
				return $this->getPrKeyword();
				break;
			case 6:
				return $this->getPrType();
				break;
			case 7:
				return $this->getPrFilename();
				break;
			case 8:
				return $this->getPrUser();
				break;
			case 9:
				return $this->getPrSlides();
				break;
			case 10:
				return $this->getPrDate();
				break;
			case 11:
				return $this->getPrHit();
				break;
			case 12:
				return $this->getPrRating();
				break;
			case 13:
				return $this->getPrStatus();
				break;
			case 14:
				return $this->getPrPlayername();
				break;
			case 15:
				return $this->getPrContent();
				break;
			case 16:
				return $this->getPrView();
				break;
			case 17:
				return $this->getPrFilesize();
				break;
			case 18:
				return $this->getPrThumbnail();
				break;
			case 19:
				return $this->getPrPrice();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
	{
		$keys = TblpresentationPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getPrId(),
			$keys[1] => $this->getPrCategory(),
			$keys[2] => $this->getPrLesson(),
			$keys[3] => $this->getPrName(),
			$keys[4] => $this->getPrSource(),
			$keys[5] => $this->getPrKeyword(),
			$keys[6] => $this->getPrType(),
			$keys[7] => $this->getPrFilename(),
			$keys[8] => $this->getPrUser(),
			$keys[9] => $this->getPrSlides(),
			$keys[10] => $this->getPrDate(),
			$keys[11] => $this->getPrHit(),
			$keys[12] => $this->getPrRating(),
			$keys[13] => $this->getPrStatus(),
			$keys[14] => $this->getPrPlayername(),
			$keys[15] => ($includeLazyLoadColumns) ? $this->getPrContent() : null,
			$keys[16] => $this->getPrView(),
			$keys[17] => $this->getPrFilesize(),
			$keys[18] => $this->getPrThumbnail(),
			$keys[19] => $this->getPrPrice(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = TblpresentationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setPrId($value);
				break;
			case 1:
				$this->setPrCategory($value);
				break;
			case 2:
				$this->setPrLesson($value);
				break;
			case 3:
				$this->setPrName($value);
				break;
			case 4:
				$this->setPrSource($value);
				break;
			case 5:
				$this->setPrKeyword($value);
				break;
			case 6:
				$this->setPrType($value);
				break;
			case 7:
				$this->setPrFilename($value);
				break;
			case 8:
				$this->setPrUser($value);
				break;
			case 9:
				$this->setPrSlides($value);
				break;
			case 10:
				$this->setPrDate($value);
				break;
			case 11:
				$this->setPrHit($value);
				break;
			case 12:
				$this->setPrRating($value);
				break;
			case 13:
				$this->setPrStatus($value);
				break;
			case 14:
				$this->setPrPlayername($value);
				break;
			case 15:
				$this->setPrContent($value);
				break;
			case 16:
				$this->setPrView($value);
				break;
			case 17:
				$this->setPrFilesize($value);
				break;
			case 18:
				$this->setPrThumbnail($value);
				break;
			case 19:
				$this->setPrPrice($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = TblpresentationPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setPrId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setPrCategory($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setPrLesson($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setPrName($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setPrSource($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setPrKeyword($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setPrType($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setPrFilename($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setPrUser($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setPrSlides($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setPrDate($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setPrHit($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setPrRating($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setPrStatus($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setPrPlayername($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setPrContent($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setPrView($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setPrFilesize($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setPrThumbnail($arr[$keys[18]]);
		if (array_key_exists($keys[19], $arr)) $this->setPrPrice($arr[$keys[19]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);

		if ($this->isColumnModified(TblpresentationPeer::PR_ID)) $criteria->add(TblpresentationPeer::PR_ID, $this->pr_id);
		if ($this->isColumnModified(TblpresentationPeer::PR_CATEGORY)) $criteria->add(TblpresentationPeer::PR_CATEGORY, $this->pr_category);
		if ($this->isColumnModified(TblpresentationPeer::PR_LESSON)) $criteria->add(TblpresentationPeer::PR_LESSON, $this->pr_lesson);
		if ($this->isColumnModified(TblpresentationPeer::PR_NAME)) $criteria->add(TblpresentationPeer::PR_NAME, $this->pr_name);
		if ($this->isColumnModified(TblpresentationPeer::PR_SOURCE)) $criteria->add(TblpresentationPeer::PR_SOURCE, $this->pr_source);
		if ($this->isColumnModified(TblpresentationPeer::PR_KEYWORD)) $criteria->add(TblpresentationPeer::PR_KEYWORD, $this->pr_keyword);
		if ($this->isColumnModified(TblpresentationPeer::PR_TYPE)) $criteria->add(TblpresentationPeer::PR_TYPE, $this->pr_type);
		if ($this->isColumnModified(TblpresentationPeer::PR_FILENAME)) $criteria->add(TblpresentationPeer::PR_FILENAME, $this->pr_filename);
		if ($this->isColumnModified(TblpresentationPeer::PR_USER)) $criteria->add(TblpresentationPeer::PR_USER, $this->pr_user);
		if ($this->isColumnModified(TblpresentationPeer::PR_SLIDES)) $criteria->add(TblpresentationPeer::PR_SLIDES, $this->pr_slides);
		if ($this->isColumnModified(TblpresentationPeer::PR_DATE)) $criteria->add(TblpresentationPeer::PR_DATE, $this->pr_date);
		if ($this->isColumnModified(TblpresentationPeer::PR_HIT)) $criteria->add(TblpresentationPeer::PR_HIT, $this->pr_hit);
		if ($this->isColumnModified(TblpresentationPeer::PR_RATING)) $criteria->add(TblpresentationPeer::PR_RATING, $this->pr_rating);
		if ($this->isColumnModified(TblpresentationPeer::PR_STATUS)) $criteria->add(TblpresentationPeer::PR_STATUS, $this->pr_status);
		if ($this->isColumnModified(TblpresentationPeer::PR_PLAYERNAME)) $criteria->add(TblpresentationPeer::PR_PLAYERNAME, $this->pr_playername);
		if ($this->isColumnModified(TblpresentationPeer::PR_CONTENT)) $criteria->add(TblpresentationPeer::PR_CONTENT, $this->pr_content);
		if ($this->isColumnModified(TblpresentationPeer::PR_VIEW)) $criteria->add(TblpresentationPeer::PR_VIEW, $this->pr_view);
		if ($this->isColumnModified(TblpresentationPeer::PR_FILESIZE)) $criteria->add(TblpresentationPeer::PR_FILESIZE, $this->pr_filesize);
		if ($this->isColumnModified(TblpresentationPeer::PR_THUMBNAIL)) $criteria->add(TblpresentationPeer::PR_THUMBNAIL, $this->pr_thumbnail);
		if ($this->isColumnModified(TblpresentationPeer::PR_PRICE)) $criteria->add(TblpresentationPeer::PR_PRICE, $this->pr_price);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);

		$criteria->add(TblpresentationPeer::PR_ID, $this->pr_id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getPrId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setPrId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setPrCategory($this->pr_category);

		$copyObj->setPrLesson($this->pr_lesson);

		$copyObj->setPrName($this->pr_name);

		$copyObj->setPrSource($this->pr_source);

		$copyObj->setPrKeyword($this->pr_keyword);

		$copyObj->setPrType($this->pr_type);

		$copyObj->setPrFilename($this->pr_filename);

		$copyObj->setPrUser($this->pr_user);

		$copyObj->setPrSlides($this->pr_slides);

		$copyObj->setPrDate($this->pr_date);

		$copyObj->setPrHit($this->pr_hit);

		$copyObj->setPrRating($this->pr_rating);

		$copyObj->setPrStatus($this->pr_status);

		$copyObj->setPrPlayername($this->pr_playername);

		$copyObj->setPrContent($this->pr_content);

		$copyObj->setPrView($this->pr_view);

		$copyObj->setPrFilesize($this->pr_filesize);

		$copyObj->setPrThumbnail($this->pr_thumbnail);

		$copyObj->setPrPrice($this->pr_price);


		if ($deepCopy) {
									$copyObj->setNew(false);

			foreach ($this->getTblblogcategoryentrys() as $relObj) {
				if ($relObj !== $this) {  					$copyObj->addTblblogcategoryentry($relObj->copy($deepCopy));
				}
			}

			foreach ($this->getTblblogentrys() as $relObj) {
				if ($relObj !== $this) {  					$copyObj->addTblblogentry($relObj->copy($deepCopy));
				}
			}

			foreach ($this->getTbluserpresentations() as $relObj) {
				if ($relObj !== $this) {  					$copyObj->addTbluserpresentation($relObj->copy($deepCopy));
				}
			}

		} 

		$copyObj->setNew(true);

		$copyObj->setPrId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new TblpresentationPeer();
		}
		return self::$peer;
	}

	
	public function setTbluser(Tbluser $v = null)
	{
		if ($v === null) {
			$this->setPrUser(NULL);
		} else {
			$this->setPrUser($v->getUsId());
		}

		$this->aTbluser = $v;

						if ($v !== null) {
			$v->addTblpresentation($this);
		}

		return $this;
	}


	
	public function getTbluser(PropelPDO $con = null)
	{
		if ($this->aTbluser === null && ($this->pr_user !== null)) {
			$this->aTbluser = TbluserPeer::retrieveByPK($this->pr_user, $con);
			
		}
		return $this->aTbluser;
	}

	
	public function clearTblblogcategoryentrys()
	{
		$this->collTblblogcategoryentrys = null; 	}

	
	public function initTblblogcategoryentrys()
	{
		$this->collTblblogcategoryentrys = array();
	}

	
	public function getTblblogcategoryentrys($criteria = null, PropelPDO $con = null)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogcategoryentrys === null) {
			if ($this->isNew()) {
			   $this->collTblblogcategoryentrys = array();
			} else {

				$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

				TblblogcategoryentryPeer::addSelectColumns($criteria);
				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

				TblblogcategoryentryPeer::addSelectColumns($criteria);
				if (!isset($this->lastTblblogcategoryentryCriteria) || !$this->lastTblblogcategoryentryCriteria->equals($criteria)) {
					$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblblogcategoryentryCriteria = $criteria;
		return $this->collTblblogcategoryentrys;
	}

	
	public function countTblblogcategoryentrys(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		} else {
			$criteria = clone $criteria;
		}

		if ($distinct) {
			$criteria->setDistinct();
		}

		$count = null;

		if ($this->collTblblogcategoryentrys === null) {
			if ($this->isNew()) {
				$count = 0;
			} else {

				$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

				$count = TblblogcategoryentryPeer::doCount($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

				if (!isset($this->lastTblblogcategoryentryCriteria) || !$this->lastTblblogcategoryentryCriteria->equals($criteria)) {
					$count = TblblogcategoryentryPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblblogcategoryentrys);
				}
			} else {
				$count = count($this->collTblblogcategoryentrys);
			}
		}
		$this->lastTblblogcategoryentryCriteria = $criteria;
		return $count;
	}

	
	public function addTblblogcategoryentry(Tblblogcategoryentry $l)
	{
		if ($this->collTblblogcategoryentrys === null) {
			$this->initTblblogcategoryentrys();
		}
		if (!in_array($l, $this->collTblblogcategoryentrys, true)) { 			array_push($this->collTblblogcategoryentrys, $l);
			$l->setTblpresentation($this);
		}
	}


	
	public function getTblblogcategoryentrysJoinTblblogentry($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogcategoryentrys === null) {
			if ($this->isNew()) {
				$this->collTblblogcategoryentrys = array();
			} else {

				$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTblblogentry($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

			if (!isset($this->lastTblblogcategoryentryCriteria) || !$this->lastTblblogcategoryentryCriteria->equals($criteria)) {
				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTblblogentry($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogcategoryentryCriteria = $criteria;

		return $this->collTblblogcategoryentrys;
	}


	
	public function getTblblogcategoryentrysJoinTbluser($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogcategoryentrys === null) {
			if ($this->isNew()) {
				$this->collTblblogcategoryentrys = array();
			} else {

				$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTbluser($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

			if (!isset($this->lastTblblogcategoryentryCriteria) || !$this->lastTblblogcategoryentryCriteria->equals($criteria)) {
				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTbluser($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogcategoryentryCriteria = $criteria;

		return $this->collTblblogcategoryentrys;
	}


	
	public function getTblblogcategoryentrysJoinTbldocument($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogcategoryentrys === null) {
			if ($this->isNew()) {
				$this->collTblblogcategoryentrys = array();
			} else {

				$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTbldocument($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->pr_id);

			if (!isset($this->lastTblblogcategoryentryCriteria) || !$this->lastTblblogcategoryentryCriteria->equals($criteria)) {
				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTbldocument($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogcategoryentryCriteria = $criteria;

		return $this->collTblblogcategoryentrys;
	}

	
	public function clearTblblogentrys()
	{
		$this->collTblblogentrys = null; 	}

	
	public function initTblblogentrys()
	{
		$this->collTblblogentrys = array();
	}

	
	public function getTblblogentrys($criteria = null, PropelPDO $con = null)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogentrys === null) {
			if ($this->isNew()) {
			   $this->collTblblogentrys = array();
			} else {

				$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

				TblblogentryPeer::addSelectColumns($criteria);
				$this->collTblblogentrys = TblblogentryPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

				TblblogentryPeer::addSelectColumns($criteria);
				if (!isset($this->lastTblblogentryCriteria) || !$this->lastTblblogentryCriteria->equals($criteria)) {
					$this->collTblblogentrys = TblblogentryPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblblogentryCriteria = $criteria;
		return $this->collTblblogentrys;
	}

	
	public function countTblblogentrys(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		} else {
			$criteria = clone $criteria;
		}

		if ($distinct) {
			$criteria->setDistinct();
		}

		$count = null;

		if ($this->collTblblogentrys === null) {
			if ($this->isNew()) {
				$count = 0;
			} else {

				$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

				$count = TblblogentryPeer::doCount($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

				if (!isset($this->lastTblblogentryCriteria) || !$this->lastTblblogentryCriteria->equals($criteria)) {
					$count = TblblogentryPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblblogentrys);
				}
			} else {
				$count = count($this->collTblblogentrys);
			}
		}
		$this->lastTblblogentryCriteria = $criteria;
		return $count;
	}

	
	public function addTblblogentry(Tblblogentry $l)
	{
		if ($this->collTblblogentrys === null) {
			$this->initTblblogentrys();
		}
		if (!in_array($l, $this->collTblblogentrys, true)) { 			array_push($this->collTblblogentrys, $l);
			$l->setTblpresentation($this);
		}
	}


	
	public function getTblblogentrysJoinTbldocument($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogentrys === null) {
			if ($this->isNew()) {
				$this->collTblblogentrys = array();
			} else {

				$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTbldocument($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

			if (!isset($this->lastTblblogentryCriteria) || !$this->lastTblblogentryCriteria->equals($criteria)) {
				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTbldocument($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogentryCriteria = $criteria;

		return $this->collTblblogentrys;
	}


	
	public function getTblblogentrysJoinTblblogcategory($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogentrys === null) {
			if ($this->isNew()) {
				$this->collTblblogentrys = array();
			} else {

				$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTblblogcategory($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

			if (!isset($this->lastTblblogentryCriteria) || !$this->lastTblblogentryCriteria->equals($criteria)) {
				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTblblogcategory($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogentryCriteria = $criteria;

		return $this->collTblblogentrys;
	}


	
	public function getTblblogentrysJoinTblblog($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogentrys === null) {
			if ($this->isNew()) {
				$this->collTblblogentrys = array();
			} else {

				$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTblblog($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

			if (!isset($this->lastTblblogentryCriteria) || !$this->lastTblblogentryCriteria->equals($criteria)) {
				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTblblog($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogentryCriteria = $criteria;

		return $this->collTblblogentrys;
	}


	
	public function getTblblogentrysJoinTbluser($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTblblogentrys === null) {
			if ($this->isNew()) {
				$this->collTblblogentrys = array();
			} else {

				$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTbluser($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentryPeer::ENTRY_LINK, $this->pr_id);

			if (!isset($this->lastTblblogentryCriteria) || !$this->lastTblblogentryCriteria->equals($criteria)) {
				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTbluser($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogentryCriteria = $criteria;

		return $this->collTblblogentrys;
	}

	
	public function clearTbluserpresentations()
	{
		$this->collTbluserpresentations = null; 	}

	
	public function initTbluserpresentations()
	{
		$this->collTbluserpresentations = array();
	}

	
	public function getTbluserpresentations($criteria = null, PropelPDO $con = null)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTbluserpresentations === null) {
			if ($this->isNew()) {
			   $this->collTbluserpresentations = array();
			} else {

				$criteria->add(TbluserpresentationPeer::USPRE_PRESENTATION, $this->pr_id);

				TbluserpresentationPeer::addSelectColumns($criteria);
				$this->collTbluserpresentations = TbluserpresentationPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TbluserpresentationPeer::USPRE_PRESENTATION, $this->pr_id);

				TbluserpresentationPeer::addSelectColumns($criteria);
				if (!isset($this->lastTbluserpresentationCriteria) || !$this->lastTbluserpresentationCriteria->equals($criteria)) {
					$this->collTbluserpresentations = TbluserpresentationPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTbluserpresentationCriteria = $criteria;
		return $this->collTbluserpresentations;
	}

	
	public function countTbluserpresentations(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblpresentationPeer::DATABASE_NAME);
		} else {
			$criteria = clone $criteria;
		}

		if ($distinct) {
			$criteria->setDistinct();
		}

		$count = null;

		if ($this->collTbluserpresentations === null) {
			if ($this->isNew()) {
				$count = 0;
			} else {

				$criteria->add(TbluserpresentationPeer::USPRE_PRESENTATION, $this->pr_id);

				$count = TbluserpresentationPeer::doCount($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TbluserpresentationPeer::USPRE_PRESENTATION, $this->pr_id);

				if (!isset($this->lastTbluserpresentationCriteria) || !$this->lastTbluserpresentationCriteria->equals($criteria)) {
					$count = TbluserpresentationPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTbluserpresentations);
				}
			} else {
				$count = count($this->collTbluserpresentations);
			}
		}
		$this->lastTbluserpresentationCriteria = $criteria;
		return $count;
	}

	
	public function addTbluserpresentation(Tbluserpresentation $l)
	{
		if ($this->collTbluserpresentations === null) {
			$this->initTbluserpresentations();
		}
		if (!in_array($l, $this->collTbluserpresentations, true)) { 			array_push($this->collTbluserpresentations, $l);
			$l->setTblpresentation($this);
		}
	}

	
	public function clearAllReferences($deep = false)
	{
		if ($deep) {
			if ($this->collTblblogcategoryentrys) {
				foreach ((array) $this->collTblblogcategoryentrys as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblblogentrys) {
				foreach ((array) $this->collTblblogentrys as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTbluserpresentations) {
				foreach ((array) $this->collTbluserpresentations as $o) {
					$o->clearAllReferences($deep);
				}
			}
		} 
		$this->collTblblogcategoryentrys = null;
		$this->collTblblogentrys = null;
		$this->collTbluserpresentations = null;
			$this->aTbluser = null;
	}

} 