<?php


abstract class BaseTblblogcategoryentry extends BaseObject  implements Persistent {


	
	protected static $peer;

	
	protected $ce_category;

	
	protected $ce_entry;

	
	protected $ce_modifydate;

	
	protected $ce_hit;

	
	protected $ce_score;

	
	protected $ce_status;

	
	protected $ce_type;

	
	protected $ce_link;

	
	protected $ce_creator;

	
	protected $ce_sender;

	
	protected $ce_title;

	
	protected $ce_filetype;

	
	protected $ce_thumbnail;

	
	protected $aTblblogentry;

	
	protected $aTbluser;

	
	protected $aTbldocument;

	
	protected $aTblpresentation;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

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

	
	public function applyDefaultValues()
	{
		$this->ce_hit = 0;
		$this->ce_score = 0;
		$this->ce_status = 0;
		$this->ce_type = 2;
		$this->ce_creator = 0;
		$this->ce_sender = 0;
		$this->ce_title = '0';
		$this->ce_thumbnail = '0';
	}

	
	public function getCeCategory()
	{
		return $this->ce_category;
	}

	
	public function getCeEntry()
	{
		return $this->ce_entry;
	}

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


		if ($this->ce_modifydate === '0000-00-00 00:00:00') {
									return null;
		} else {
			try {
				$dt = new DateTime($this->ce_modifydate);
			} catch (Exception $x) {
				throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ce_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 getCeHit()
	{
		return $this->ce_hit;
	}

	
	public function getCeScore()
	{
		return $this->ce_score;
	}

	
	public function getCeStatus()
	{
		return $this->ce_status;
	}

	
	public function getCeType()
	{
		return $this->ce_type;
	}

	
	public function getCeLink()
	{
		return $this->ce_link;
	}

	
	public function getCeCreator()
	{
		return $this->ce_creator;
	}

	
	public function getCeSender()
	{
		return $this->ce_sender;
	}

	
	public function getCeTitle()
	{
		return $this->ce_title;
	}

	
	public function getCeFiletype()
	{
		return $this->ce_filetype;
	}

	
	public function getCeThumbnail()
	{
		return $this->ce_thumbnail;
	}

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

		if ($this->ce_category !== $v) {
			$this->ce_category = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_CATEGORY;
		}

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

		if ($this->ce_entry !== $v) {
			$this->ce_entry = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_ENTRY;
		}

		if ($this->aTblblogentry !== null && $this->aTblblogentry->getEntryId() !== $v) {
			$this->aTblblogentry = null;
		}

		return $this;
	} 
	
	public function setCeModifydate($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->ce_modifydate !== null || $dt !== null ) {
			
			$currNorm = ($this->ce_modifydate !== null && $tmpDt = new DateTime($this->ce_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->ce_modifydate = ($dt ? $dt->format('Y-m-d H:i:s') : null);
				$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_MODIFYDATE;
			}
		} 
		return $this;
	} 
	
	public function setCeHit($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->ce_hit !== $v || $v === 0) {
			$this->ce_hit = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_HIT;
		}

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

		if ($this->ce_score !== $v || $v === 0) {
			$this->ce_score = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_SCORE;
		}

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

		if ($this->ce_status !== $v || $v === 0) {
			$this->ce_status = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_STATUS;
		}

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

		if ($this->ce_type !== $v || $v === 2) {
			$this->ce_type = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_TYPE;
		}

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

		if ($this->ce_link !== $v) {
			$this->ce_link = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_LINK;
		}

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

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

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

		if ($this->ce_creator !== $v || $v === 0) {
			$this->ce_creator = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_CREATOR;
		}

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

		if ($this->ce_sender !== $v || $v === 0) {
			$this->ce_sender = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_SENDER;
		}

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

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

		if ($this->ce_title !== $v || $v === '0') {
			$this->ce_title = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_TITLE;
		}

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

		if ($this->ce_filetype !== $v) {
			$this->ce_filetype = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_FILETYPE;
		}

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

		if ($this->ce_thumbnail !== $v || $v === '0') {
			$this->ce_thumbnail = $v;
			$this->modifiedColumns[] = TblblogcategoryentryPeer::CE_THUMBNAIL;
		}

		return $this;
	} 
	
	public function hasOnlyDefaultValues()
	{
						if (array_diff($this->modifiedColumns, array(TblblogcategoryentryPeer::CE_HIT,TblblogcategoryentryPeer::CE_SCORE,TblblogcategoryentryPeer::CE_STATUS,TblblogcategoryentryPeer::CE_TYPE,TblblogcategoryentryPeer::CE_CREATOR,TblblogcategoryentryPeer::CE_SENDER,TblblogcategoryentryPeer::CE_TITLE,TblblogcategoryentryPeer::CE_THUMBNAIL))) {
				return false;
			}

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

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

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

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

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

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

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

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

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

			$this->ce_category = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
			$this->ce_entry = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
			$this->ce_modifydate = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
			$this->ce_hit = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
			$this->ce_score = ($row[$startcol + 4] !== null) ? (double) $row[$startcol + 4] : null;
			$this->ce_status = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
			$this->ce_type = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
			$this->ce_link = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
			$this->ce_creator = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
			$this->ce_sender = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null;
			$this->ce_title = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
			$this->ce_filetype = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
			$this->ce_thumbnail = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
			$this->resetModified();

			$this->setNew(false);

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

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

	
	public function ensureConsistency()
	{

		if ($this->aTblblogentry !== null && $this->ce_entry !== $this->aTblblogentry->getEntryId()) {
			$this->aTblblogentry = null;
		}
		if ($this->aTbldocument !== null && $this->ce_link !== $this->aTbldocument->getDocId()) {
			$this->aTbldocument = null;
		}
		if ($this->aTblpresentation !== null && $this->ce_link !== $this->aTblpresentation->getPrId()) {
			$this->aTblpresentation = null;
		}
		if ($this->aTbluser !== null && $this->ce_sender !== $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(TblblogcategoryentryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

				
		$stmt = TblblogcategoryentryPeer::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); 
		if ($deep) {  
			$this->aTblblogentry = null;
			$this->aTbluser = null;
			$this->aTbldocument = null;
			$this->aTblpresentation = 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(TblblogcategoryentryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		
		$con->beginTransaction();
		try {
			TblblogcategoryentryPeer::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(TblblogcategoryentryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		
		$con->beginTransaction();
		try {
			$affectedRows = $this->doSave($con);
			$con->commit();
			TblblogcategoryentryPeer::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->aTblblogentry !== null) {
				if ($this->aTblblogentry->isModified() || $this->aTblblogentry->isNew()) {
					$affectedRows += $this->aTblblogentry->save($con);
				}
				$this->setTblblogentry($this->aTblblogentry);
			}

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

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

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


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

				$this->resetModified(); 			}

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

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

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

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


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



			$this->alreadyInValidation = false;
		}

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

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

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getCeCategory();
				break;
			case 1:
				return $this->getCeEntry();
				break;
			case 2:
				return $this->getCeModifydate();
				break;
			case 3:
				return $this->getCeHit();
				break;
			case 4:
				return $this->getCeScore();
				break;
			case 5:
				return $this->getCeStatus();
				break;
			case 6:
				return $this->getCeType();
				break;
			case 7:
				return $this->getCeLink();
				break;
			case 8:
				return $this->getCeCreator();
				break;
			case 9:
				return $this->getCeSender();
				break;
			case 10:
				return $this->getCeTitle();
				break;
			case 11:
				return $this->getCeFiletype();
				break;
			case 12:
				return $this->getCeThumbnail();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
	{
		$keys = TblblogcategoryentryPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getCeCategory(),
			$keys[1] => $this->getCeEntry(),
			$keys[2] => $this->getCeModifydate(),
			$keys[3] => $this->getCeHit(),
			$keys[4] => $this->getCeScore(),
			$keys[5] => $this->getCeStatus(),
			$keys[6] => $this->getCeType(),
			$keys[7] => $this->getCeLink(),
			$keys[8] => $this->getCeCreator(),
			$keys[9] => $this->getCeSender(),
			$keys[10] => $this->getCeTitle(),
			$keys[11] => $this->getCeFiletype(),
			$keys[12] => $this->getCeThumbnail(),
		);
		return $result;
	}

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

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setCeCategory($value);
				break;
			case 1:
				$this->setCeEntry($value);
				break;
			case 2:
				$this->setCeModifydate($value);
				break;
			case 3:
				$this->setCeHit($value);
				break;
			case 4:
				$this->setCeScore($value);
				break;
			case 5:
				$this->setCeStatus($value);
				break;
			case 6:
				$this->setCeType($value);
				break;
			case 7:
				$this->setCeLink($value);
				break;
			case 8:
				$this->setCeCreator($value);
				break;
			case 9:
				$this->setCeSender($value);
				break;
			case 10:
				$this->setCeTitle($value);
				break;
			case 11:
				$this->setCeFiletype($value);
				break;
			case 12:
				$this->setCeThumbnail($value);
				break;
		} 	}

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

		if (array_key_exists($keys[0], $arr)) $this->setCeCategory($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setCeEntry($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setCeModifydate($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setCeHit($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setCeScore($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setCeStatus($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setCeType($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setCeLink($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setCeCreator($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setCeSender($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setCeTitle($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setCeFiletype($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setCeThumbnail($arr[$keys[12]]);
	}

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

		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_CATEGORY)) $criteria->add(TblblogcategoryentryPeer::CE_CATEGORY, $this->ce_category);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_ENTRY)) $criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->ce_entry);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_MODIFYDATE)) $criteria->add(TblblogcategoryentryPeer::CE_MODIFYDATE, $this->ce_modifydate);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_HIT)) $criteria->add(TblblogcategoryentryPeer::CE_HIT, $this->ce_hit);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_SCORE)) $criteria->add(TblblogcategoryentryPeer::CE_SCORE, $this->ce_score);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_STATUS)) $criteria->add(TblblogcategoryentryPeer::CE_STATUS, $this->ce_status);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_TYPE)) $criteria->add(TblblogcategoryentryPeer::CE_TYPE, $this->ce_type);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_LINK)) $criteria->add(TblblogcategoryentryPeer::CE_LINK, $this->ce_link);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_CREATOR)) $criteria->add(TblblogcategoryentryPeer::CE_CREATOR, $this->ce_creator);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_SENDER)) $criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->ce_sender);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_TITLE)) $criteria->add(TblblogcategoryentryPeer::CE_TITLE, $this->ce_title);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_FILETYPE)) $criteria->add(TblblogcategoryentryPeer::CE_FILETYPE, $this->ce_filetype);
		if ($this->isColumnModified(TblblogcategoryentryPeer::CE_THUMBNAIL)) $criteria->add(TblblogcategoryentryPeer::CE_THUMBNAIL, $this->ce_thumbnail);

		return $criteria;
	}

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

		$criteria->add(TblblogcategoryentryPeer::CE_CATEGORY, $this->ce_category);
		$criteria->add(TblblogcategoryentryPeer::CE_ENTRY, $this->ce_entry);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		$pks = array();

		$pks[0] = $this->getCeCategory();

		$pks[1] = $this->getCeEntry();

		return $pks;
	}

	
	public function setPrimaryKey($keys)
	{

		$this->setCeCategory($keys[0]);

		$this->setCeEntry($keys[1]);

	}

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

		$copyObj->setCeCategory($this->ce_category);

		$copyObj->setCeEntry($this->ce_entry);

		$copyObj->setCeModifydate($this->ce_modifydate);

		$copyObj->setCeHit($this->ce_hit);

		$copyObj->setCeScore($this->ce_score);

		$copyObj->setCeStatus($this->ce_status);

		$copyObj->setCeType($this->ce_type);

		$copyObj->setCeLink($this->ce_link);

		$copyObj->setCeCreator($this->ce_creator);

		$copyObj->setCeSender($this->ce_sender);

		$copyObj->setCeTitle($this->ce_title);

		$copyObj->setCeFiletype($this->ce_filetype);

		$copyObj->setCeThumbnail($this->ce_thumbnail);


		$copyObj->setNew(true);

	}

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

	
	public function setTblblogentry(Tblblogentry $v = null)
	{
		if ($v === null) {
			$this->setCeEntry(NULL);
		} else {
			$this->setCeEntry($v->getEntryId());
		}

		$this->aTblblogentry = $v;

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

		return $this;
	}


	
	public function getTblblogentry(PropelPDO $con = null)
	{
		if ($this->aTblblogentry === null && ($this->ce_entry !== null)) {
			$this->aTblblogentry = TblblogentryPeer::retrieveByPK($this->ce_entry, $con);
			
		}
		return $this->aTblblogentry;
	}

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

		$this->aTbluser = $v;

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

		return $this;
	}


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

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

		$this->aTbldocument = $v;

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

		return $this;
	}


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

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

		$this->aTblpresentation = $v;

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

		return $this;
	}


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

	
	public function clearAllReferences($deep = false)
	{
		if ($deep) {
		} 
			$this->aTblblogentry = null;
			$this->aTbluser = null;
			$this->aTbldocument = null;
			$this->aTblpresentation = null;
	}

} 