<?php


abstract class BaseTblblogentry extends BaseObject  implements Persistent {


	
	protected static $peer;

	
	protected $entry_id;

	
	protected $entry_user;

	
	protected $entry_link;

	
	protected $entry_title;

	
	protected $entry_content;

	
	protected $entry_content_isLoaded = false;

	
	protected $entry_createdate;

	
	protected $entry_modifydate;

	
	protected $entry_hit;

	
	protected $entry_score;

	
	protected $entry_status;

	
	protected $entry_category;

	
	protected $entry_lesson;

	
	protected $entry_type;

	
	protected $entry_blog;

	
	protected $entry_thumb;

	
	protected $entry_thumbnail;

	
	protected $entry_like;

	
	protected $entry_likeinfo;

	
	protected $aTblpresentation;

	
	protected $aTbldocument;

	
	protected $aTblblogcategory;

	
	protected $aTblblog;

	
	protected $aTbluser;

	
	protected $collTblblogcategoryentrys;

	
	private $lastTblblogcategoryentryCriteria = null;

	
	protected $collTblblogentrycomments;

	
	private $lastTblblogentrycommentCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

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

	
	public function applyDefaultValues()
	{
		$this->entry_hit = 0;
		$this->entry_score = 0;
		$this->entry_status = 0;
		$this->entry_type = 2;
		$this->entry_blog = 0;
		$this->entry_like = 0;
	}

	
	public function getEntryId()
	{
		return $this->entry_id;
	}

	
	public function getEntryUser()
	{
		return $this->entry_user;
	}

	
	public function getEntryLink()
	{
		return $this->entry_link;
	}

	
	public function getEntryTitle()
	{
		return $this->entry_title;
	}

	
	public function getEntryContent(PropelPDO $con = null)
	{
		if (!$this->entry_content_isLoaded && $this->entry_content === null && !$this->isNew()) {
			$this->loadEntryContent($con);
		}

		return $this->entry_content;
	}

	
	protected function loadEntryContent(PropelPDO $con = null)
	{
		$c = $this->buildPkeyCriteria();
		$c->addSelectColumn(TblblogentryPeer::ENTRY_CONTENT);
		try {
			$stmt = TblblogentryPeer::doSelectStmt($c, $con);
			$row = $stmt->fetch(PDO::FETCH_NUM);
			$stmt->closeCursor();
			$this->entry_content = ($row[0] !== null) ? (string) $row[0] : null;
			$this->entry_content_isLoaded = true;
		} catch (Exception $e) {
			throw new PropelException("Error loading value for [entry_content] column on demand.", $e);
		}
	}
	
	public function getEntryCreatedate($format = 'Y-m-d H:i:s')
	{
		if ($this->entry_createdate === null) {
			return null;
		}


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

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

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


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

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

	
	public function getEntryHit()
	{
		return $this->entry_hit;
	}

	
	public function getEntryScore()
	{
		return $this->entry_score;
	}

	
	public function getEntryStatus()
	{
		return $this->entry_status;
	}

	
	public function getEntryCategory()
	{
		return $this->entry_category;
	}

	
	public function getEntryLesson()
	{
		return $this->entry_lesson;
	}

	
	public function getEntryType()
	{
		return $this->entry_type;
	}

	
	public function getEntryBlog()
	{
		return $this->entry_blog;
	}

	
	public function getEntryThumb()
	{
		return $this->entry_thumb;
	}

	
	public function getEntryThumbnail()
	{
		return $this->entry_thumbnail;
	}

	
	public function getEntryLike()
	{
		return $this->entry_like;
	}

	
	public function getEntryLikeinfo()
	{
		return $this->entry_likeinfo;
	}

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

		if ($this->entry_id !== $v) {
			$this->entry_id = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_ID;
		}

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

		if ($this->entry_user !== $v) {
			$this->entry_user = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_USER;
		}

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

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

		if ($this->entry_link !== $v) {
			$this->entry_link = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_LINK;
		}

		if ($this->aTblpresentation !== null && $this->aTblpresentation->getPrId() !== $v) {
			$this->aTblpresentation = null;
		}

		if ($this->aTbldocument !== null && $this->aTbldocument->getDocId() !== $v) {
			$this->aTbldocument = null;
		}

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

		if ($this->entry_title !== $v) {
			$this->entry_title = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_TITLE;
		}

		return $this;
	} 
	
	public function setEntryContent($v)
	{
										$this->entry_content_isLoaded = true;

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

		if ($this->entry_content !== $v) {
			$this->entry_content = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_CONTENT;
		}

		return $this;
	} 
	
	public function setEntryCreatedate($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->entry_createdate !== null || $dt !== null ) {
			
			$currNorm = ($this->entry_createdate !== null && $tmpDt = new DateTime($this->entry_createdate)) ? $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->entry_createdate = ($dt ? $dt->format('Y-m-d H:i:s') : null);
				$this->modifiedColumns[] = TblblogentryPeer::ENTRY_CREATEDATE;
			}
		} 
		return $this;
	} 
	
	public function setEntryModifydate($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->entry_modifydate !== null || $dt !== null ) {
			
			$currNorm = ($this->entry_modifydate !== null && $tmpDt = new DateTime($this->entry_modifydate)) ? $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->entry_modifydate = ($dt ? $dt->format('Y-m-d H:i:s') : null);
				$this->modifiedColumns[] = TblblogentryPeer::ENTRY_MODIFYDATE;
			}
		} 
		return $this;
	} 
	
	public function setEntryHit($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->entry_hit !== $v || $v === 0) {
			$this->entry_hit = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_HIT;
		}

		return $this;
	} 
	
	public function setEntryScore($v)
	{
		if ($v !== null) {
			$v = (double) $v;
		}

		if ($this->entry_score !== $v || $v === 0) {
			$this->entry_score = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_SCORE;
		}

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

		if ($this->entry_status !== $v || $v === 0) {
			$this->entry_status = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_STATUS;
		}

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

		if ($this->entry_category !== $v) {
			$this->entry_category = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_CATEGORY;
		}

		if ($this->aTblblogcategory !== null && $this->aTblblogcategory->getCatId() !== $v) {
			$this->aTblblogcategory = null;
		}

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

		if ($this->entry_lesson !== $v) {
			$this->entry_lesson = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_LESSON;
		}

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

		if ($this->entry_type !== $v || $v === 2) {
			$this->entry_type = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_TYPE;
		}

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

		if ($this->entry_blog !== $v || $v === 0) {
			$this->entry_blog = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_BLOG;
		}

		if ($this->aTblblog !== null && $this->aTblblog->getBlId() !== $v) {
			$this->aTblblog = null;
		}

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

		if ($this->entry_thumb !== $v) {
			$this->entry_thumb = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_THUMB;
		}

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

		if ($this->entry_thumbnail !== $v) {
			$this->entry_thumbnail = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_THUMBNAIL;
		}

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

		if ($this->entry_like !== $v || $v === 0) {
			$this->entry_like = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_LIKE;
		}

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

		if ($this->entry_likeinfo !== $v) {
			$this->entry_likeinfo = $v;
			$this->modifiedColumns[] = TblblogentryPeer::ENTRY_LIKEINFO;
		}

		return $this;
	} 
	
	public function hasOnlyDefaultValues()
	{
						if (array_diff($this->modifiedColumns, array(TblblogentryPeer::ENTRY_HIT,TblblogentryPeer::ENTRY_SCORE,TblblogentryPeer::ENTRY_STATUS,TblblogentryPeer::ENTRY_TYPE,TblblogentryPeer::ENTRY_BLOG,TblblogentryPeer::ENTRY_LIKE))) {
				return false;
			}

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

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

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

			if ($this->entry_type !== 2) {
				return false;
			}

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

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

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

			$this->entry_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
			$this->entry_user = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
			$this->entry_link = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
			$this->entry_title = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
			$this->entry_createdate = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
			$this->entry_modifydate = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
			$this->entry_hit = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
			$this->entry_score = ($row[$startcol + 7] !== null) ? (double) $row[$startcol + 7] : null;
			$this->entry_status = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
			$this->entry_category = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null;
			$this->entry_lesson = ($row[$startcol + 10] !== null) ? (int) $row[$startcol + 10] : null;
			$this->entry_type = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null;
			$this->entry_blog = ($row[$startcol + 12] !== null) ? (int) $row[$startcol + 12] : null;
			$this->entry_thumb = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
			$this->entry_thumbnail = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
			$this->entry_like = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null;
			$this->entry_likeinfo = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null;
			$this->resetModified();

			$this->setNew(false);

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

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

	
	public function ensureConsistency()
	{

		if ($this->aTbluser !== null && $this->entry_user !== $this->aTbluser->getUsId()) {
			$this->aTbluser = null;
		}
		if ($this->aTblpresentation !== null && $this->entry_link !== $this->aTblpresentation->getPrId()) {
			$this->aTblpresentation = null;
		}
		if ($this->aTbldocument !== null && $this->entry_link !== $this->aTbldocument->getDocId()) {
			$this->aTbldocument = null;
		}
		if ($this->aTblblogcategory !== null && $this->entry_category !== $this->aTblblogcategory->getCatId()) {
			$this->aTblblogcategory = null;
		}
		if ($this->aTblblog !== null && $this->entry_blog !== $this->aTblblog->getBlId()) {
			$this->aTblblog = 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(TblblogentryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

				
		$stmt = TblblogentryPeer::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->entry_content = null;
		$this->entry_content_isLoaded = false;

		if ($deep) {  
			$this->aTblpresentation = null;
			$this->aTbldocument = null;
			$this->aTblblogcategory = null;
			$this->aTblblog = null;
			$this->aTbluser = null;
			$this->collTblblogcategoryentrys = null;
			$this->lastTblblogcategoryentryCriteria = null;

			$this->collTblblogentrycomments = null;
			$this->lastTblblogentrycommentCriteria = 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(TblblogentryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		
		$con->beginTransaction();
		try {
			TblblogentryPeer::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(TblblogentryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		
		$con->beginTransaction();
		try {
			$affectedRows = $this->doSave($con);
			$con->commit();
			TblblogentryPeer::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->aTblpresentation !== null) {
				if ($this->aTblpresentation->isModified() || $this->aTblpresentation->isNew()) {
					$affectedRows += $this->aTblpresentation->save($con);
				}
				$this->setTblpresentation($this->aTblpresentation);
			}

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

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

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

			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[] = TblblogentryPeer::ENTRY_ID;
			}

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

				$this->resetModified(); 			}

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

			if ($this->collTblblogentrycomments !== null) {
				foreach ($this->collTblblogentrycomments 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->aTblpresentation !== null) {
				if (!$this->aTblpresentation->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aTblpresentation->getValidationFailures());
				}
			}

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

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

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

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


			if (($retval = TblblogentryPeer::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->collTblblogentrycomments !== null) {
					foreach ($this->collTblblogentrycomments 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 = TblblogentryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		$field = $this->getByPosition($pos);
		return $field;
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getEntryId();
				break;
			case 1:
				return $this->getEntryUser();
				break;
			case 2:
				return $this->getEntryLink();
				break;
			case 3:
				return $this->getEntryTitle();
				break;
			case 4:
				return $this->getEntryContent();
				break;
			case 5:
				return $this->getEntryCreatedate();
				break;
			case 6:
				return $this->getEntryModifydate();
				break;
			case 7:
				return $this->getEntryHit();
				break;
			case 8:
				return $this->getEntryScore();
				break;
			case 9:
				return $this->getEntryStatus();
				break;
			case 10:
				return $this->getEntryCategory();
				break;
			case 11:
				return $this->getEntryLesson();
				break;
			case 12:
				return $this->getEntryType();
				break;
			case 13:
				return $this->getEntryBlog();
				break;
			case 14:
				return $this->getEntryThumb();
				break;
			case 15:
				return $this->getEntryThumbnail();
				break;
			case 16:
				return $this->getEntryLike();
				break;
			case 17:
				return $this->getEntryLikeinfo();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
	{
		$keys = TblblogentryPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getEntryId(),
			$keys[1] => $this->getEntryUser(),
			$keys[2] => $this->getEntryLink(),
			$keys[3] => $this->getEntryTitle(),
			$keys[4] => ($includeLazyLoadColumns) ? $this->getEntryContent() : null,
			$keys[5] => $this->getEntryCreatedate(),
			$keys[6] => $this->getEntryModifydate(),
			$keys[7] => $this->getEntryHit(),
			$keys[8] => $this->getEntryScore(),
			$keys[9] => $this->getEntryStatus(),
			$keys[10] => $this->getEntryCategory(),
			$keys[11] => $this->getEntryLesson(),
			$keys[12] => $this->getEntryType(),
			$keys[13] => $this->getEntryBlog(),
			$keys[14] => $this->getEntryThumb(),
			$keys[15] => $this->getEntryThumbnail(),
			$keys[16] => $this->getEntryLike(),
			$keys[17] => $this->getEntryLikeinfo(),
		);
		return $result;
	}

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

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setEntryId($value);
				break;
			case 1:
				$this->setEntryUser($value);
				break;
			case 2:
				$this->setEntryLink($value);
				break;
			case 3:
				$this->setEntryTitle($value);
				break;
			case 4:
				$this->setEntryContent($value);
				break;
			case 5:
				$this->setEntryCreatedate($value);
				break;
			case 6:
				$this->setEntryModifydate($value);
				break;
			case 7:
				$this->setEntryHit($value);
				break;
			case 8:
				$this->setEntryScore($value);
				break;
			case 9:
				$this->setEntryStatus($value);
				break;
			case 10:
				$this->setEntryCategory($value);
				break;
			case 11:
				$this->setEntryLesson($value);
				break;
			case 12:
				$this->setEntryType($value);
				break;
			case 13:
				$this->setEntryBlog($value);
				break;
			case 14:
				$this->setEntryThumb($value);
				break;
			case 15:
				$this->setEntryThumbnail($value);
				break;
			case 16:
				$this->setEntryLike($value);
				break;
			case 17:
				$this->setEntryLikeinfo($value);
				break;
		} 	}

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

		if (array_key_exists($keys[0], $arr)) $this->setEntryId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setEntryUser($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setEntryLink($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setEntryTitle($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setEntryContent($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setEntryCreatedate($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setEntryModifydate($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setEntryHit($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setEntryScore($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setEntryStatus($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setEntryCategory($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setEntryLesson($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setEntryType($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setEntryBlog($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setEntryThumb($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setEntryThumbnail($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setEntryLike($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setEntryLikeinfo($arr[$keys[17]]);
	}

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

		if ($this->isColumnModified(TblblogentryPeer::ENTRY_ID)) $criteria->add(TblblogentryPeer::ENTRY_ID, $this->entry_id);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_USER)) $criteria->add(TblblogentryPeer::ENTRY_USER, $this->entry_user);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_LINK)) $criteria->add(TblblogentryPeer::ENTRY_LINK, $this->entry_link);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_TITLE)) $criteria->add(TblblogentryPeer::ENTRY_TITLE, $this->entry_title);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_CONTENT)) $criteria->add(TblblogentryPeer::ENTRY_CONTENT, $this->entry_content);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_CREATEDATE)) $criteria->add(TblblogentryPeer::ENTRY_CREATEDATE, $this->entry_createdate);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_MODIFYDATE)) $criteria->add(TblblogentryPeer::ENTRY_MODIFYDATE, $this->entry_modifydate);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_HIT)) $criteria->add(TblblogentryPeer::ENTRY_HIT, $this->entry_hit);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_SCORE)) $criteria->add(TblblogentryPeer::ENTRY_SCORE, $this->entry_score);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_STATUS)) $criteria->add(TblblogentryPeer::ENTRY_STATUS, $this->entry_status);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_CATEGORY)) $criteria->add(TblblogentryPeer::ENTRY_CATEGORY, $this->entry_category);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_LESSON)) $criteria->add(TblblogentryPeer::ENTRY_LESSON, $this->entry_lesson);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_TYPE)) $criteria->add(TblblogentryPeer::ENTRY_TYPE, $this->entry_type);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_BLOG)) $criteria->add(TblblogentryPeer::ENTRY_BLOG, $this->entry_blog);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_THUMB)) $criteria->add(TblblogentryPeer::ENTRY_THUMB, $this->entry_thumb);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_THUMBNAIL)) $criteria->add(TblblogentryPeer::ENTRY_THUMBNAIL, $this->entry_thumbnail);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_LIKE)) $criteria->add(TblblogentryPeer::ENTRY_LIKE, $this->entry_like);
		if ($this->isColumnModified(TblblogentryPeer::ENTRY_LIKEINFO)) $criteria->add(TblblogentryPeer::ENTRY_LIKEINFO, $this->entry_likeinfo);

		return $criteria;
	}

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

		$criteria->add(TblblogentryPeer::ENTRY_ID, $this->entry_id);

		return $criteria;
	}

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

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

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

		$copyObj->setEntryUser($this->entry_user);

		$copyObj->setEntryLink($this->entry_link);

		$copyObj->setEntryTitle($this->entry_title);

		$copyObj->setEntryContent($this->entry_content);

		$copyObj->setEntryCreatedate($this->entry_createdate);

		$copyObj->setEntryModifydate($this->entry_modifydate);

		$copyObj->setEntryHit($this->entry_hit);

		$copyObj->setEntryScore($this->entry_score);

		$copyObj->setEntryStatus($this->entry_status);

		$copyObj->setEntryCategory($this->entry_category);

		$copyObj->setEntryLesson($this->entry_lesson);

		$copyObj->setEntryType($this->entry_type);

		$copyObj->setEntryBlog($this->entry_blog);

		$copyObj->setEntryThumb($this->entry_thumb);

		$copyObj->setEntryThumbnail($this->entry_thumbnail);

		$copyObj->setEntryLike($this->entry_like);

		$copyObj->setEntryLikeinfo($this->entry_likeinfo);


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

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

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

		} 

		$copyObj->setNew(true);

		$copyObj->setEntryId(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 TblblogentryPeer();
		}
		return self::$peer;
	}

	
	public function setTblpresentation(Tblpresentation $v = null)
	{
		if ($v === null) {
			$this->setEntryLink(NULL);
		} else {
			$this->setEntryLink($v->getPrId());
		}

		$this->aTblpresentation = $v;

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

		return $this;
	}


	
	public function getTblpresentation(PropelPDO $con = null)
	{
		if ($this->aTblpresentation === null && ($this->entry_link !== null)) {
			$this->aTblpresentation = TblpresentationPeer::retrieveByPK($this->entry_link, $con);
			
		}
		return $this->aTblpresentation;
	}

	
	public function setTbldocument(Tbldocument $v = null)
	{
		if ($v === null) {
			$this->setEntryLink(NULL);
		} else {
			$this->setEntryLink($v->getDocId());
		}

		$this->aTbldocument = $v;

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

		return $this;
	}


	
	public function getTbldocument(PropelPDO $con = null)
	{
		if ($this->aTbldocument === null && ($this->entry_link !== null)) {
			$this->aTbldocument = TbldocumentPeer::retrieveByPK($this->entry_link, $con);
			
		}
		return $this->aTbldocument;
	}

	
	public function setTblblogcategory(Tblblogcategory $v = null)
	{
		if ($v === null) {
			$this->setEntryCategory(NULL);
		} else {
			$this->setEntryCategory($v->getCatId());
		}

		$this->aTblblogcategory = $v;

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

		return $this;
	}


	
	public function getTblblogcategory(PropelPDO $con = null)
	{
		if ($this->aTblblogcategory === null && ($this->entry_category !== null)) {
			$this->aTblblogcategory = TblblogcategoryPeer::retrieveByPK($this->entry_category, $con);
			
		}
		return $this->aTblblogcategory;
	}

	
	public function setTblblog(Tblblog $v = null)
	{
		if ($v === null) {
			$this->setEntryBlog(0);
		} else {
			$this->setEntryBlog($v->getBlId());
		}

		$this->aTblblog = $v;

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

		return $this;
	}


	
	public function getTblblog(PropelPDO $con = null)
	{
		if ($this->aTblblog === null && ($this->entry_blog !== null)) {
			$this->aTblblog = TblblogPeer::retrieveByPK($this->entry_blog, $con);
			
		}
		return $this->aTblblog;
	}

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

		$this->aTbluser = $v;

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

		return $this;
	}


	
	public function getTbluser(PropelPDO $con = null)
	{
		if ($this->aTbluser === null && ($this->entry_user !== null)) {
			$this->aTbluser = TbluserPeer::retrieveByPK($this->entry_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(TblblogentryPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_id);

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

				$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_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(TblblogentryPeer::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_ENTRY, $this->entry_id);

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

				$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_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->setTblblogentry($this);
		}
	}


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

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

				$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTbluser($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_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(TblblogentryPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTbldocument($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_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 getTblblogcategoryentrysJoinTblpresentation($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TblblogentryPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTblpresentation($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->entry_id);

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

		return $this->collTblblogcategoryentrys;
	}

	
	public function clearTblblogentrycomments()
	{
		$this->collTblblogentrycomments = null; 	}

	
	public function initTblblogentrycomments()
	{
		$this->collTblblogentrycomments = array();
	}

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

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

				$criteria->add(TblblogentrycommentPeer::CM_ENTRY, $this->entry_id);

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

				$criteria->add(TblblogentrycommentPeer::CM_ENTRY, $this->entry_id);

				TblblogentrycommentPeer::addSelectColumns($criteria);
				if (!isset($this->lastTblblogentrycommentCriteria) || !$this->lastTblblogentrycommentCriteria->equals($criteria)) {
					$this->collTblblogentrycomments = TblblogentrycommentPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblblogentrycommentCriteria = $criteria;
		return $this->collTblblogentrycomments;
	}

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

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

		$count = null;

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

				$criteria->add(TblblogentrycommentPeer::CM_ENTRY, $this->entry_id);

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

				$criteria->add(TblblogentrycommentPeer::CM_ENTRY, $this->entry_id);

				if (!isset($this->lastTblblogentrycommentCriteria) || !$this->lastTblblogentrycommentCriteria->equals($criteria)) {
					$count = TblblogentrycommentPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblblogentrycomments);
				}
			} else {
				$count = count($this->collTblblogentrycomments);
			}
		}
		$this->lastTblblogentrycommentCriteria = $criteria;
		return $count;
	}

	
	public function addTblblogentrycomment(Tblblogentrycomment $l)
	{
		if ($this->collTblblogentrycomments === null) {
			$this->initTblblogentrycomments();
		}
		if (!in_array($l, $this->collTblblogentrycomments, true)) { 			array_push($this->collTblblogentrycomments, $l);
			$l->setTblblogentry($this);
		}
	}


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

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

				$criteria->add(TblblogentrycommentPeer::CM_ENTRY, $this->entry_id);

				$this->collTblblogentrycomments = TblblogentrycommentPeer::doSelectJoinTbluser($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentrycommentPeer::CM_ENTRY, $this->entry_id);

			if (!isset($this->lastTblblogentrycommentCriteria) || !$this->lastTblblogentrycommentCriteria->equals($criteria)) {
				$this->collTblblogentrycomments = TblblogentrycommentPeer::doSelectJoinTbluser($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogentrycommentCriteria = $criteria;

		return $this->collTblblogentrycomments;
	}


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

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

				$criteria->add(TblblogentrycommentPeer::CM_ENTRY, $this->entry_id);

				$this->collTblblogentrycomments = TblblogentrycommentPeer::doSelectJoinTblblog($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentrycommentPeer::CM_ENTRY, $this->entry_id);

			if (!isset($this->lastTblblogentrycommentCriteria) || !$this->lastTblblogentrycommentCriteria->equals($criteria)) {
				$this->collTblblogentrycomments = TblblogentrycommentPeer::doSelectJoinTblblog($criteria, $con, $join_behavior);
			}
		}
		$this->lastTblblogentrycommentCriteria = $criteria;

		return $this->collTblblogentrycomments;
	}

	
	public function clearAllReferences($deep = false)
	{
		if ($deep) {
			if ($this->collTblblogcategoryentrys) {
				foreach ((array) $this->collTblblogcategoryentrys as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblblogentrycomments) {
				foreach ((array) $this->collTblblogentrycomments as $o) {
					$o->clearAllReferences($deep);
				}
			}
		} 
		$this->collTblblogcategoryentrys = null;
		$this->collTblblogentrycomments = null;
			$this->aTblpresentation = null;
			$this->aTbldocument = null;
			$this->aTblblogcategory = null;
			$this->aTblblog = null;
			$this->aTbluser = null;
	}

} 