<?php


abstract class BaseTbluser extends BaseObject  implements Persistent {


	
	protected static $peer;

	
	protected $us_id;

	
	protected $us_username;

	
	protected $us_password;

	
	protected $us_firstname;

	
	protected $us_lastname;

	
	protected $us_sex;

	
	protected $us_email;

	
	protected $us_phone;

	
	protected $us_aclgroup;

	
	protected $us_school;

	
	protected $us_province;

	
	protected $us_lastvisited;

	
	protected $us_registerdate;

	
	protected $us_rating;

	
	protected $us_download;

	
	protected $us_avatar;

	
	protected $us_status;

	
	protected $us_key;

	
	protected $us_score;

	
	protected $us_pointplus;

	
	protected $us_checked;

	
	protected $us_checkinfo;

	
	protected $us_idmd5;

	
	protected $us_homepage;

	
	protected $us_money;

	
	protected $collTblblogs;

	
	private $lastTblblogCriteria = null;

	
	protected $collTblblogcategoryentrys;

	
	private $lastTblblogcategoryentryCriteria = null;

	
	protected $singleTblblogcheckinfo;

	
	protected $collTblblogentrys;

	
	private $lastTblblogentryCriteria = null;

	
	protected $collTblblogentrycomments;

	
	private $lastTblblogentrycommentCriteria = null;

	
	protected $collTblblogusers;

	
	private $lastTblbloguserCriteria = null;

	
	protected $collTblbloguserchecks;

	
	private $lastTblblogusercheckCriteria = null;

	
	protected $collTblcomplains;

	
	private $lastTblcomplainCriteria = null;

	
	protected $collTbldocuments;

	
	private $lastTbldocumentCriteria = null;

	
	protected $collTblpresentations;

	
	private $lastTblpresentationCriteria = null;

	
	protected $collTbluserdayscores;

	
	private $lastTbluserdayscoreCriteria = null;

	
	protected $collTblusertempscores;

	
	private $lastTblusertempscoreCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

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

	
	public function applyDefaultValues()
	{
		$this->us_sex = 0;
		$this->us_rating = 0;
		$this->us_download = 0;
		$this->us_status = 0;
		$this->us_key = 0;
		$this->us_score = 0;
		$this->us_pointplus = 5;
		$this->us_checked = 0;
		$this->us_money = 0;
	}

	
	public function getUsId()
	{
		return $this->us_id;
	}

	
	public function getUsUsername()
	{
		return $this->us_username;
	}

	
	public function getUsPassword()
	{
		return $this->us_password;
	}

	
	public function getUsFirstname()
	{
		return $this->us_firstname;
	}

	
	public function getUsLastname()
	{
		return $this->us_lastname;
	}

	
	public function getUsSex()
	{
		return $this->us_sex;
	}

	
	public function getUsEmail()
	{
		return $this->us_email;
	}

	
	public function getUsPhone()
	{
		return $this->us_phone;
	}

	
	public function getUsAclgroup()
	{
		return $this->us_aclgroup;
	}

	
	public function getUsSchool()
	{
		return $this->us_school;
	}

	
	public function getUsProvince()
	{
		return $this->us_province;
	}

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


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

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

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


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

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

	
	public function getUsRating()
	{
		return $this->us_rating;
	}

	
	public function getUsDownload()
	{
		return $this->us_download;
	}

	
	public function getUsAvatar()
	{
		return $this->us_avatar;
	}

	
	public function getUsStatus()
	{
		return $this->us_status;
	}

	
	public function getUsKey()
	{
		return $this->us_key;
	}

	
	public function getUsScore()
	{
		return $this->us_score;
	}

	
	public function getUsPointplus()
	{
		return $this->us_pointplus;
	}

	
	public function getUsChecked()
	{
		return $this->us_checked;
	}

	
	public function getUsCheckinfo()
	{
		return $this->us_checkinfo;
	}

	
	public function getUsIdmd5()
	{
		return $this->us_idmd5;
	}

	
	public function getUsHomepage()
	{
		return $this->us_homepage;
	}

	
	public function getUsMoney()
	{
		return $this->us_money;
	}

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

		if ($this->us_id !== $v) {
			$this->us_id = $v;
			$this->modifiedColumns[] = TbluserPeer::US_ID;
		}

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

		if ($this->us_username !== $v) {
			$this->us_username = $v;
			$this->modifiedColumns[] = TbluserPeer::US_USERNAME;
		}

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

		if ($this->us_password !== $v) {
			$this->us_password = $v;
			$this->modifiedColumns[] = TbluserPeer::US_PASSWORD;
		}

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

		if ($this->us_firstname !== $v) {
			$this->us_firstname = $v;
			$this->modifiedColumns[] = TbluserPeer::US_FIRSTNAME;
		}

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

		if ($this->us_lastname !== $v) {
			$this->us_lastname = $v;
			$this->modifiedColumns[] = TbluserPeer::US_LASTNAME;
		}

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

		if ($this->us_sex !== $v || $v === 0) {
			$this->us_sex = $v;
			$this->modifiedColumns[] = TbluserPeer::US_SEX;
		}

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

		if ($this->us_email !== $v) {
			$this->us_email = $v;
			$this->modifiedColumns[] = TbluserPeer::US_EMAIL;
		}

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

		if ($this->us_phone !== $v) {
			$this->us_phone = $v;
			$this->modifiedColumns[] = TbluserPeer::US_PHONE;
		}

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

		if ($this->us_aclgroup !== $v) {
			$this->us_aclgroup = $v;
			$this->modifiedColumns[] = TbluserPeer::US_ACLGROUP;
		}

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

		if ($this->us_school !== $v) {
			$this->us_school = $v;
			$this->modifiedColumns[] = TbluserPeer::US_SCHOOL;
		}

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

		if ($this->us_province !== $v) {
			$this->us_province = $v;
			$this->modifiedColumns[] = TbluserPeer::US_PROVINCE;
		}

		return $this;
	} 
	
	public function setUsLastvisited($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->us_lastvisited !== null || $dt !== null ) {
			
			$currNorm = ($this->us_lastvisited !== null && $tmpDt = new DateTime($this->us_lastvisited)) ? $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->us_lastvisited = ($dt ? $dt->format('Y-m-d H:i:s') : null);
				$this->modifiedColumns[] = TbluserPeer::US_LASTVISITED;
			}
		} 
		return $this;
	} 
	
	public function setUsRegisterdate($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->us_registerdate !== null || $dt !== null ) {
			
			$currNorm = ($this->us_registerdate !== null && $tmpDt = new DateTime($this->us_registerdate)) ? $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->us_registerdate = ($dt ? $dt->format('Y-m-d H:i:s') : null);
				$this->modifiedColumns[] = TbluserPeer::US_REGISTERDATE;
			}
		}*/ 
		$this->us_registerdate = $v;
		$this->modifiedColumns[] = TbluserPeer::US_REGISTERDATE;
		return $this;
	} 
	
	public function setUsRating($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->us_rating !== $v || $v === 0) {
			$this->us_rating = $v;
			$this->modifiedColumns[] = TbluserPeer::US_RATING;
		}

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

		if ($this->us_download !== $v || $v === 0) {
			$this->us_download = $v;
			$this->modifiedColumns[] = TbluserPeer::US_DOWNLOAD;
		}

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

		if ($this->us_avatar !== $v) {
			$this->us_avatar = $v;
			$this->modifiedColumns[] = TbluserPeer::US_AVATAR;
		}

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

		if ($this->us_status !== $v || $v === 0) {
			$this->us_status = $v;
			$this->modifiedColumns[] = TbluserPeer::US_STATUS;
		}

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

		if ($this->us_key !== $v || $v === 0) {
			$this->us_key = $v;
			$this->modifiedColumns[] = TbluserPeer::US_KEY;
		}

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

		if ($this->us_score !== $v || $v === 0) {
			$this->us_score = $v;
			$this->modifiedColumns[] = TbluserPeer::US_SCORE;
		}

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

		if ($this->us_pointplus !== $v || $v === 5) {
			$this->us_pointplus = $v;
			$this->modifiedColumns[] = TbluserPeer::US_POINTPLUS;
		}

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

		if ($this->us_checked !== $v || $v === 0) {
			$this->us_checked = $v;
			$this->modifiedColumns[] = TbluserPeer::US_CHECKED;
		}

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

		if ($this->us_checkinfo !== $v) {
			$this->us_checkinfo = $v;
			$this->modifiedColumns[] = TbluserPeer::US_CHECKINFO;
		}

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

		if ($this->us_idmd5 !== $v) {
			$this->us_idmd5 = $v;
			$this->modifiedColumns[] = TbluserPeer::US_IDMD5;
		}

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

		if ($this->us_homepage !== $v) {
			$this->us_homepage = $v;
			$this->modifiedColumns[] = TbluserPeer::US_HOMEPAGE;
		}

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

		if ($this->us_money !== $v || $v === 0) {
			$this->us_money = $v;
			$this->modifiedColumns[] = TbluserPeer::US_MONEY;
		}

		return $this;
	} 
	
	public function hasOnlyDefaultValues()
	{
						if (array_diff($this->modifiedColumns, array(TbluserPeer::US_SEX,TbluserPeer::US_RATING,TbluserPeer::US_DOWNLOAD,TbluserPeer::US_STATUS,TbluserPeer::US_KEY,TbluserPeer::US_SCORE,TbluserPeer::US_POINTPLUS,TbluserPeer::US_CHECKED,TbluserPeer::US_MONEY))) {
				return false;
			}

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

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

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

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

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

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

			if ($this->us_pointplus !== 5) {
				return false;
			}

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

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

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

			$this->us_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
			$this->us_username = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
			$this->us_password = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
			$this->us_firstname = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
			$this->us_lastname = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
			$this->us_sex = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
			$this->us_email = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
			$this->us_phone = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
			$this->us_aclgroup = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
			$this->us_school = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
			$this->us_province = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
			$this->us_lastvisited = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
			$this->us_registerdate = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
			$this->us_rating = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
			$this->us_download = ($row[$startcol + 14] !== null) ? (int) $row[$startcol + 14] : null;
			$this->us_avatar = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null;
			$this->us_status = ($row[$startcol + 16] !== null) ? (int) $row[$startcol + 16] : null;
			$this->us_key = ($row[$startcol + 17] !== null) ? (int) $row[$startcol + 17] : null;
			$this->us_score = ($row[$startcol + 18] !== null) ? (int) $row[$startcol + 18] : null;
			$this->us_pointplus = ($row[$startcol + 19] !== null) ? (int) $row[$startcol + 19] : null;
			$this->us_checked = ($row[$startcol + 20] !== null) ? (int) $row[$startcol + 20] : null;
			$this->us_checkinfo = ($row[$startcol + 21] !== null) ? (int) $row[$startcol + 21] : null;
			$this->us_idmd5 = ($row[$startcol + 22] !== null) ? (string) $row[$startcol + 22] : null;
			$this->us_homepage = ($row[$startcol + 23] !== null) ? (string) $row[$startcol + 23] : null;
			$this->us_money = ($row[$startcol + 24] !== null) ? (int) $row[$startcol + 24] : null;
			$this->resetModified();

			$this->setNew(false);

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

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

	
	public function ensureConsistency()
	{

	} 
	
	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(TbluserPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

				
		$stmt = TbluserPeer::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->collTblblogs = null;
			$this->lastTblblogCriteria = null;

			$this->collTblblogcategoryentrys = null;
			$this->lastTblblogcategoryentryCriteria = null;

			$this->singleTblblogcheckinfo = null;

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

			$this->collTblblogentrycomments = null;
			$this->lastTblblogentrycommentCriteria = null;

			$this->collTblblogusers = null;
			$this->lastTblbloguserCriteria = null;

			$this->collTblbloguserchecks = null;
			$this->lastTblblogusercheckCriteria = null;

			$this->collTblcomplains = null;
			$this->lastTblcomplainCriteria = null;

			$this->collTbldocuments = null;
			$this->lastTbldocumentCriteria = null;

			$this->collTblpresentations = null;
			$this->lastTblpresentationCriteria = null;

			$this->collTbluserdayscores = null;
			$this->lastTbluserdayscoreCriteria = null;

			$this->collTblusertempscores = null;
			$this->lastTblusertempscoreCriteria = 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(TbluserPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		
		$con->beginTransaction();
		try {
			TbluserPeer::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(TbluserPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}
		
		$con->beginTransaction();
		try {
			$affectedRows = $this->doSave($con);
			$con->commit();
			TbluserPeer::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->isNew() ) {
				$this->modifiedColumns[] = TbluserPeer::US_ID;
			}

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

				$this->resetModified(); 			}

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

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

			if ($this->singleTblblogcheckinfo !== null) {
				if (!$this->singleTblblogcheckinfo->isDeleted()) {
						$affectedRows += $this->singleTblblogcheckinfo->save($con);
				}
			}

			if ($this->collTblblogentrys !== null) {
				foreach ($this->collTblblogentrys 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);
					}
				}
			}

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

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

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

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

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

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

			if ($this->collTblusertempscores !== null) {
				foreach ($this->collTblusertempscores 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 (($retval = TbluserPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


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

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

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

				if ($this->collTblblogentrys !== null) {
					foreach ($this->collTblblogentrys 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());
						}
					}
				}

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

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

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

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

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

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

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

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getUsId();
				break;
			case 1:
				return $this->getUsUsername();
				break;
			case 2:
				return $this->getUsPassword();
				break;
			case 3:
				return $this->getUsFirstname();
				break;
			case 4:
				return $this->getUsLastname();
				break;
			case 5:
				return $this->getUsSex();
				break;
			case 6:
				return $this->getUsEmail();
				break;
			case 7:
				return $this->getUsPhone();
				break;
			case 8:
				return $this->getUsAclgroup();
				break;
			case 9:
				return $this->getUsSchool();
				break;
			case 10:
				return $this->getUsProvince();
				break;
			case 11:
				return $this->getUsLastvisited();
				break;
			case 12:
				return $this->getUsRegisterdate();
				break;
			case 13:
				return $this->getUsRating();
				break;
			case 14:
				return $this->getUsDownload();
				break;
			case 15:
				return $this->getUsAvatar();
				break;
			case 16:
				return $this->getUsStatus();
				break;
			case 17:
				return $this->getUsKey();
				break;
			case 18:
				return $this->getUsScore();
				break;
			case 19:
				return $this->getUsPointplus();
				break;
			case 20:
				return $this->getUsChecked();
				break;
			case 21:
				return $this->getUsCheckinfo();
				break;
			case 22:
				return $this->getUsIdmd5();
				break;
			case 23:
				return $this->getUsHomepage();
				break;
			case 24:
				return $this->getUsMoney();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
	{
		$keys = TbluserPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getUsId(),
			$keys[1] => $this->getUsUsername(),
			$keys[2] => $this->getUsPassword(),
			$keys[3] => $this->getUsFirstname(),
			$keys[4] => $this->getUsLastname(),
			$keys[5] => $this->getUsSex(),
			$keys[6] => $this->getUsEmail(),
			$keys[7] => $this->getUsPhone(),
			$keys[8] => $this->getUsAclgroup(),
			$keys[9] => $this->getUsSchool(),
			$keys[10] => $this->getUsProvince(),
			$keys[11] => $this->getUsLastvisited(),
			$keys[12] => $this->getUsRegisterdate(),
			$keys[13] => $this->getUsRating(),
			$keys[14] => $this->getUsDownload(),
			$keys[15] => $this->getUsAvatar(),
			$keys[16] => $this->getUsStatus(),
			$keys[17] => $this->getUsKey(),
			$keys[18] => $this->getUsScore(),
			$keys[19] => $this->getUsPointplus(),
			$keys[20] => $this->getUsChecked(),
			$keys[21] => $this->getUsCheckinfo(),
			$keys[22] => $this->getUsIdmd5(),
			$keys[23] => $this->getUsHomepage(),
			$keys[24] => $this->getUsMoney(),
		);
		return $result;
	}

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

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setUsId($value);
				break;
			case 1:
				$this->setUsUsername($value);
				break;
			case 2:
				$this->setUsPassword($value);
				break;
			case 3:
				$this->setUsFirstname($value);
				break;
			case 4:
				$this->setUsLastname($value);
				break;
			case 5:
				$this->setUsSex($value);
				break;
			case 6:
				$this->setUsEmail($value);
				break;
			case 7:
				$this->setUsPhone($value);
				break;
			case 8:
				$this->setUsAclgroup($value);
				break;
			case 9:
				$this->setUsSchool($value);
				break;
			case 10:
				$this->setUsProvince($value);
				break;
			case 11:
				$this->setUsLastvisited($value);
				break;
			case 12:
				$this->setUsRegisterdate($value);
				break;
			case 13:
				$this->setUsRating($value);
				break;
			case 14:
				$this->setUsDownload($value);
				break;
			case 15:
				$this->setUsAvatar($value);
				break;
			case 16:
				$this->setUsStatus($value);
				break;
			case 17:
				$this->setUsKey($value);
				break;
			case 18:
				$this->setUsScore($value);
				break;
			case 19:
				$this->setUsPointplus($value);
				break;
			case 20:
				$this->setUsChecked($value);
				break;
			case 21:
				$this->setUsCheckinfo($value);
				break;
			case 22:
				$this->setUsIdmd5($value);
				break;
			case 23:
				$this->setUsHomepage($value);
				break;
			case 24:
				$this->setUsMoney($value);
				break;
		} 	}

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

		if (array_key_exists($keys[0], $arr)) $this->setUsId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setUsUsername($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setUsPassword($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setUsFirstname($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setUsLastname($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setUsSex($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setUsEmail($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setUsPhone($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setUsAclgroup($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setUsSchool($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setUsProvince($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setUsLastvisited($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setUsRegisterdate($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setUsRating($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setUsDownload($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setUsAvatar($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setUsStatus($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setUsKey($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setUsScore($arr[$keys[18]]);
		if (array_key_exists($keys[19], $arr)) $this->setUsPointplus($arr[$keys[19]]);
		if (array_key_exists($keys[20], $arr)) $this->setUsChecked($arr[$keys[20]]);
		if (array_key_exists($keys[21], $arr)) $this->setUsCheckinfo($arr[$keys[21]]);
		if (array_key_exists($keys[22], $arr)) $this->setUsIdmd5($arr[$keys[22]]);
		if (array_key_exists($keys[23], $arr)) $this->setUsHomepage($arr[$keys[23]]);
		if (array_key_exists($keys[24], $arr)) $this->setUsMoney($arr[$keys[24]]);
	}

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

		if ($this->isColumnModified(TbluserPeer::US_ID)) $criteria->add(TbluserPeer::US_ID, $this->us_id);
		if ($this->isColumnModified(TbluserPeer::US_USERNAME)) $criteria->add(TbluserPeer::US_USERNAME, $this->us_username);
		if ($this->isColumnModified(TbluserPeer::US_PASSWORD)) $criteria->add(TbluserPeer::US_PASSWORD, $this->us_password);
		if ($this->isColumnModified(TbluserPeer::US_FIRSTNAME)) $criteria->add(TbluserPeer::US_FIRSTNAME, $this->us_firstname);
		if ($this->isColumnModified(TbluserPeer::US_LASTNAME)) $criteria->add(TbluserPeer::US_LASTNAME, $this->us_lastname);
		if ($this->isColumnModified(TbluserPeer::US_SEX)) $criteria->add(TbluserPeer::US_SEX, $this->us_sex);
		if ($this->isColumnModified(TbluserPeer::US_EMAIL)) $criteria->add(TbluserPeer::US_EMAIL, $this->us_email);
		if ($this->isColumnModified(TbluserPeer::US_PHONE)) $criteria->add(TbluserPeer::US_PHONE, $this->us_phone);
		if ($this->isColumnModified(TbluserPeer::US_ACLGROUP)) $criteria->add(TbluserPeer::US_ACLGROUP, $this->us_aclgroup);
		if ($this->isColumnModified(TbluserPeer::US_SCHOOL)) $criteria->add(TbluserPeer::US_SCHOOL, $this->us_school);
		if ($this->isColumnModified(TbluserPeer::US_PROVINCE)) $criteria->add(TbluserPeer::US_PROVINCE, $this->us_province);
		if ($this->isColumnModified(TbluserPeer::US_LASTVISITED)) $criteria->add(TbluserPeer::US_LASTVISITED, $this->us_lastvisited);
		if ($this->isColumnModified(TbluserPeer::US_REGISTERDATE)) $criteria->add(TbluserPeer::US_REGISTERDATE, $this->us_registerdate);
		if ($this->isColumnModified(TbluserPeer::US_RATING)) $criteria->add(TbluserPeer::US_RATING, $this->us_rating);
		if ($this->isColumnModified(TbluserPeer::US_DOWNLOAD)) $criteria->add(TbluserPeer::US_DOWNLOAD, $this->us_download);
		if ($this->isColumnModified(TbluserPeer::US_AVATAR)) $criteria->add(TbluserPeer::US_AVATAR, $this->us_avatar);
		if ($this->isColumnModified(TbluserPeer::US_STATUS)) $criteria->add(TbluserPeer::US_STATUS, $this->us_status);
		if ($this->isColumnModified(TbluserPeer::US_KEY)) $criteria->add(TbluserPeer::US_KEY, $this->us_key);
		if ($this->isColumnModified(TbluserPeer::US_SCORE)) $criteria->add(TbluserPeer::US_SCORE, $this->us_score);
		if ($this->isColumnModified(TbluserPeer::US_POINTPLUS)) $criteria->add(TbluserPeer::US_POINTPLUS, $this->us_pointplus);
		if ($this->isColumnModified(TbluserPeer::US_CHECKED)) $criteria->add(TbluserPeer::US_CHECKED, $this->us_checked);
		if ($this->isColumnModified(TbluserPeer::US_CHECKINFO)) $criteria->add(TbluserPeer::US_CHECKINFO, $this->us_checkinfo);
		if ($this->isColumnModified(TbluserPeer::US_IDMD5)) $criteria->add(TbluserPeer::US_IDMD5, $this->us_idmd5);
		if ($this->isColumnModified(TbluserPeer::US_HOMEPAGE)) $criteria->add(TbluserPeer::US_HOMEPAGE, $this->us_homepage);
		if ($this->isColumnModified(TbluserPeer::US_MONEY)) $criteria->add(TbluserPeer::US_MONEY, $this->us_money);

		return $criteria;
	}

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

		$criteria->add(TbluserPeer::US_ID, $this->us_id);

		return $criteria;
	}

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

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

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

		$copyObj->setUsUsername($this->us_username);

		$copyObj->setUsPassword($this->us_password);

		$copyObj->setUsFirstname($this->us_firstname);

		$copyObj->setUsLastname($this->us_lastname);

		$copyObj->setUsSex($this->us_sex);

		$copyObj->setUsEmail($this->us_email);

		$copyObj->setUsPhone($this->us_phone);

		$copyObj->setUsAclgroup($this->us_aclgroup);

		$copyObj->setUsSchool($this->us_school);

		$copyObj->setUsProvince($this->us_province);

		$copyObj->setUsLastvisited($this->us_lastvisited);

		$copyObj->setUsRegisterdate($this->us_registerdate);

		$copyObj->setUsRating($this->us_rating);

		$copyObj->setUsDownload($this->us_download);

		$copyObj->setUsAvatar($this->us_avatar);

		$copyObj->setUsStatus($this->us_status);

		$copyObj->setUsKey($this->us_key);

		$copyObj->setUsScore($this->us_score);

		$copyObj->setUsPointplus($this->us_pointplus);

		$copyObj->setUsChecked($this->us_checked);

		$copyObj->setUsCheckinfo($this->us_checkinfo);

		$copyObj->setUsIdmd5($this->us_idmd5);

		$copyObj->setUsHomepage($this->us_homepage);

		$copyObj->setUsMoney($this->us_money);


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

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

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

			$relObj = $this->getTblblogcheckinfo();
			if ($relObj) {
				$copyObj->setTblblogcheckinfo($relObj->copy($deepCopy));
			}

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

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

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

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

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

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

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

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

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

		} 

		$copyObj->setNew(true);

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

	
	public function clearTblblogs()
	{
		$this->collTblblogs = null; 	}

	
	public function initTblblogs()
	{
		$this->collTblblogs = array();
	}

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

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

				$criteria->add(TblblogPeer::BL_USER, $this->us_id);

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

				$criteria->add(TblblogPeer::BL_USER, $this->us_id);

				TblblogPeer::addSelectColumns($criteria);
				if (!isset($this->lastTblblogCriteria) || !$this->lastTblblogCriteria->equals($criteria)) {
					$this->collTblblogs = TblblogPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblblogCriteria = $criteria;
		return $this->collTblblogs;
	}

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

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

		$count = null;

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

				$criteria->add(TblblogPeer::BL_USER, $this->us_id);

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

				$criteria->add(TblblogPeer::BL_USER, $this->us_id);

				if (!isset($this->lastTblblogCriteria) || !$this->lastTblblogCriteria->equals($criteria)) {
					$count = TblblogPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblblogs);
				}
			} else {
				$count = count($this->collTblblogs);
			}
		}
		$this->lastTblblogCriteria = $criteria;
		return $count;
	}

	
	public function addTblblog(Tblblog $l)
	{
		if ($this->collTblblogs === null) {
			$this->initTblblogs();
		}
		if (!in_array($l, $this->collTblblogs, true)) { 			array_push($this->collTblblogs, $l);
			$l->setTbluser($this);
		}
	}

	
	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(TbluserPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_id);

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

				$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_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(TbluserPeer::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_SENDER, $this->us_id);

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

				$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_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->setTbluser($this);
		}
	}


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

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

				$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTblblogentry($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_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 getTblblogcategoryentrysJoinTbldocument($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		if ($criteria === null) {
			$criteria = new Criteria(TbluserPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTbldocument($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_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(TbluserPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_id);

				$this->collTblblogcategoryentrys = TblblogcategoryentryPeer::doSelectJoinTblpresentation($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogcategoryentryPeer::CE_SENDER, $this->us_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 getTblblogcheckinfo(PropelPDO $con = null)
	{

		if ($this->singleTblblogcheckinfo === null && !$this->isNew()) {
			$this->singleTblblogcheckinfo = TblblogcheckinfoPeer::retrieveByPK($this->us_id, $con);
		}

		return $this->singleTblblogcheckinfo;
	}

	
	public function setTblblogcheckinfo(Tblblogcheckinfo $v)
	{
		$this->singleTblblogcheckinfo = $v;

				if ($v->getTbluser() === null) {
			$v->setTbluser($this);
		}

		return $this;
	}

	
	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(TbluserPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_id);

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

				$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_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(TbluserPeer::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_USER, $this->us_id);

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

				$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_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->setTbluser($this);
		}
	}


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

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

				$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_id);

				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTblpresentation($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_id);

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

		return $this->collTblblogentrys;
	}


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

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

				$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_id);

				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTbldocument($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_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(TbluserPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_id);

				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTblblogcategory($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_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(TbluserPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_id);

				$this->collTblblogentrys = TblblogentryPeer::doSelectJoinTblblog($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentryPeer::ENTRY_USER, $this->us_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 clearTblblogentrycomments()
	{
		$this->collTblblogentrycomments = null; 	}

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

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

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

				$criteria->add(TblblogentrycommentPeer::CM_USER, $this->us_id);

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

				$criteria->add(TblblogentrycommentPeer::CM_USER, $this->us_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(TbluserPeer::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_USER, $this->us_id);

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

				$criteria->add(TblblogentrycommentPeer::CM_USER, $this->us_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->setTbluser($this);
		}
	}


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

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

				$criteria->add(TblblogentrycommentPeer::CM_USER, $this->us_id);

				$this->collTblblogentrycomments = TblblogentrycommentPeer::doSelectJoinTblblogentry($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentrycommentPeer::CM_USER, $this->us_id);

			if (!isset($this->lastTblblogentrycommentCriteria) || !$this->lastTblblogentrycommentCriteria->equals($criteria)) {
				$this->collTblblogentrycomments = TblblogentrycommentPeer::doSelectJoinTblblogentry($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(TbluserPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

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

				$criteria->add(TblblogentrycommentPeer::CM_USER, $this->us_id);

				$this->collTblblogentrycomments = TblblogentrycommentPeer::doSelectJoinTblblog($criteria, $con, $join_behavior);
			}
		} else {
									
			$criteria->add(TblblogentrycommentPeer::CM_USER, $this->us_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 clearTblblogusers()
	{
		$this->collTblblogusers = null; 	}

	
	public function initTblblogusers()
	{
		$this->collTblblogusers = array();
	}

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

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

				$criteria->add(TblbloguserPeer::US_USER, $this->us_id);

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

				$criteria->add(TblbloguserPeer::US_USER, $this->us_id);

				TblbloguserPeer::addSelectColumns($criteria);
				if (!isset($this->lastTblbloguserCriteria) || !$this->lastTblbloguserCriteria->equals($criteria)) {
					$this->collTblblogusers = TblbloguserPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblbloguserCriteria = $criteria;
		return $this->collTblblogusers;
	}

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

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

		$count = null;

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

				$criteria->add(TblbloguserPeer::US_USER, $this->us_id);

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

				$criteria->add(TblbloguserPeer::US_USER, $this->us_id);

				if (!isset($this->lastTblbloguserCriteria) || !$this->lastTblbloguserCriteria->equals($criteria)) {
					$count = TblbloguserPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblblogusers);
				}
			} else {
				$count = count($this->collTblblogusers);
			}
		}
		$this->lastTblbloguserCriteria = $criteria;
		return $count;
	}

	
	public function addTblbloguser(Tblbloguser $l)
	{
		if ($this->collTblblogusers === null) {
			$this->initTblblogusers();
		}
		if (!in_array($l, $this->collTblblogusers, true)) { 			array_push($this->collTblblogusers, $l);
			$l->setTbluser($this);
		}
	}

	
	public function clearTblbloguserchecks()
	{
		$this->collTblbloguserchecks = null; 	}

	
	public function initTblbloguserchecks()
	{
		$this->collTblbloguserchecks = array();
	}

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

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

				$criteria->add(TblblogusercheckPeer::UC_USER, $this->us_id);

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

				$criteria->add(TblblogusercheckPeer::UC_USER, $this->us_id);

				TblblogusercheckPeer::addSelectColumns($criteria);
				if (!isset($this->lastTblblogusercheckCriteria) || !$this->lastTblblogusercheckCriteria->equals($criteria)) {
					$this->collTblbloguserchecks = TblblogusercheckPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblblogusercheckCriteria = $criteria;
		return $this->collTblbloguserchecks;
	}

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

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

		$count = null;

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

				$criteria->add(TblblogusercheckPeer::UC_USER, $this->us_id);

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

				$criteria->add(TblblogusercheckPeer::UC_USER, $this->us_id);

				if (!isset($this->lastTblblogusercheckCriteria) || !$this->lastTblblogusercheckCriteria->equals($criteria)) {
					$count = TblblogusercheckPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblbloguserchecks);
				}
			} else {
				$count = count($this->collTblbloguserchecks);
			}
		}
		$this->lastTblblogusercheckCriteria = $criteria;
		return $count;
	}

	
	public function addTblblogusercheck(Tblblogusercheck $l)
	{
		if ($this->collTblbloguserchecks === null) {
			$this->initTblbloguserchecks();
		}
		if (!in_array($l, $this->collTblbloguserchecks, true)) { 			array_push($this->collTblbloguserchecks, $l);
			$l->setTbluser($this);
		}
	}

	
	public function clearTblcomplains()
	{
		$this->collTblcomplains = null; 	}

	
	public function initTblcomplains()
	{
		$this->collTblcomplains = array();
	}

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

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

				$criteria->add(TblcomplainPeer::CP_USER, $this->us_id);

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

				$criteria->add(TblcomplainPeer::CP_USER, $this->us_id);

				TblcomplainPeer::addSelectColumns($criteria);
				if (!isset($this->lastTblcomplainCriteria) || !$this->lastTblcomplainCriteria->equals($criteria)) {
					$this->collTblcomplains = TblcomplainPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblcomplainCriteria = $criteria;
		return $this->collTblcomplains;
	}

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

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

		$count = null;

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

				$criteria->add(TblcomplainPeer::CP_USER, $this->us_id);

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

				$criteria->add(TblcomplainPeer::CP_USER, $this->us_id);

				if (!isset($this->lastTblcomplainCriteria) || !$this->lastTblcomplainCriteria->equals($criteria)) {
					$count = TblcomplainPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblcomplains);
				}
			} else {
				$count = count($this->collTblcomplains);
			}
		}
		$this->lastTblcomplainCriteria = $criteria;
		return $count;
	}

	
	public function addTblcomplain(Tblcomplain $l)
	{
		if ($this->collTblcomplains === null) {
			$this->initTblcomplains();
		}
		if (!in_array($l, $this->collTblcomplains, true)) { 			array_push($this->collTblcomplains, $l);
			$l->setTbluser($this);
		}
	}

	
	public function clearTbldocuments()
	{
		$this->collTbldocuments = null; 	}

	
	public function initTbldocuments()
	{
		$this->collTbldocuments = array();
	}

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

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

				$criteria->add(TbldocumentPeer::DOC_USER, $this->us_id);

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

				$criteria->add(TbldocumentPeer::DOC_USER, $this->us_id);

				TbldocumentPeer::addSelectColumns($criteria);
				if (!isset($this->lastTbldocumentCriteria) || !$this->lastTbldocumentCriteria->equals($criteria)) {
					$this->collTbldocuments = TbldocumentPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTbldocumentCriteria = $criteria;
		return $this->collTbldocuments;
	}

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

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

		$count = null;

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

				$criteria->add(TbldocumentPeer::DOC_USER, $this->us_id);

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

				$criteria->add(TbldocumentPeer::DOC_USER, $this->us_id);

				if (!isset($this->lastTbldocumentCriteria) || !$this->lastTbldocumentCriteria->equals($criteria)) {
					$count = TbldocumentPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTbldocuments);
				}
			} else {
				$count = count($this->collTbldocuments);
			}
		}
		$this->lastTbldocumentCriteria = $criteria;
		return $count;
	}

	
	public function addTbldocument(Tbldocument $l)
	{
		if ($this->collTbldocuments === null) {
			$this->initTbldocuments();
		}
		if (!in_array($l, $this->collTbldocuments, true)) { 			array_push($this->collTbldocuments, $l);
			$l->setTbluser($this);
		}
	}

	
	public function clearTblpresentations()
	{
		$this->collTblpresentations = null; 	}

	
	public function initTblpresentations()
	{
		$this->collTblpresentations = array();
	}

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

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

				$criteria->add(TblpresentationPeer::PR_USER, $this->us_id);

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

				$criteria->add(TblpresentationPeer::PR_USER, $this->us_id);

				TblpresentationPeer::addSelectColumns($criteria);
				if (!isset($this->lastTblpresentationCriteria) || !$this->lastTblpresentationCriteria->equals($criteria)) {
					$this->collTblpresentations = TblpresentationPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblpresentationCriteria = $criteria;
		return $this->collTblpresentations;
	}

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

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

		$count = null;

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

				$criteria->add(TblpresentationPeer::PR_USER, $this->us_id);

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

				$criteria->add(TblpresentationPeer::PR_USER, $this->us_id);

				if (!isset($this->lastTblpresentationCriteria) || !$this->lastTblpresentationCriteria->equals($criteria)) {
					$count = TblpresentationPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblpresentations);
				}
			} else {
				$count = count($this->collTblpresentations);
			}
		}
		$this->lastTblpresentationCriteria = $criteria;
		return $count;
	}

	
	public function addTblpresentation(Tblpresentation $l)
	{
		if ($this->collTblpresentations === null) {
			$this->initTblpresentations();
		}
		if (!in_array($l, $this->collTblpresentations, true)) { 			array_push($this->collTblpresentations, $l);
			$l->setTbluser($this);
		}
	}

	
	public function clearTbluserdayscores()
	{
		$this->collTbluserdayscores = null; 	}

	
	public function initTbluserdayscores()
	{
		$this->collTbluserdayscores = array();
	}

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

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

				$criteria->add(TbluserdayscorePeer::UDSC_USER, $this->us_id);

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

				$criteria->add(TbluserdayscorePeer::UDSC_USER, $this->us_id);

				TbluserdayscorePeer::addSelectColumns($criteria);
				if (!isset($this->lastTbluserdayscoreCriteria) || !$this->lastTbluserdayscoreCriteria->equals($criteria)) {
					$this->collTbluserdayscores = TbluserdayscorePeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTbluserdayscoreCriteria = $criteria;
		return $this->collTbluserdayscores;
	}

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

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

		$count = null;

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

				$criteria->add(TbluserdayscorePeer::UDSC_USER, $this->us_id);

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

				$criteria->add(TbluserdayscorePeer::UDSC_USER, $this->us_id);

				if (!isset($this->lastTbluserdayscoreCriteria) || !$this->lastTbluserdayscoreCriteria->equals($criteria)) {
					$count = TbluserdayscorePeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTbluserdayscores);
				}
			} else {
				$count = count($this->collTbluserdayscores);
			}
		}
		$this->lastTbluserdayscoreCriteria = $criteria;
		return $count;
	}

	
	public function addTbluserdayscore(Tbluserdayscore $l)
	{
		if ($this->collTbluserdayscores === null) {
			$this->initTbluserdayscores();
		}
		if (!in_array($l, $this->collTbluserdayscores, true)) { 			array_push($this->collTbluserdayscores, $l);
			$l->setTbluser($this);
		}
	}

	
	public function clearTblusertempscores()
	{
		$this->collTblusertempscores = null; 	}

	
	public function initTblusertempscores()
	{
		$this->collTblusertempscores = array();
	}

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

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

				$criteria->add(TblusertempscorePeer::UTSC_USER, $this->us_id);

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

				$criteria->add(TblusertempscorePeer::UTSC_USER, $this->us_id);

				TblusertempscorePeer::addSelectColumns($criteria);
				if (!isset($this->lastTblusertempscoreCriteria) || !$this->lastTblusertempscoreCriteria->equals($criteria)) {
					$this->collTblusertempscores = TblusertempscorePeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTblusertempscoreCriteria = $criteria;
		return $this->collTblusertempscores;
	}

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

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

		$count = null;

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

				$criteria->add(TblusertempscorePeer::UTSC_USER, $this->us_id);

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

				$criteria->add(TblusertempscorePeer::UTSC_USER, $this->us_id);

				if (!isset($this->lastTblusertempscoreCriteria) || !$this->lastTblusertempscoreCriteria->equals($criteria)) {
					$count = TblusertempscorePeer::doCount($criteria, $con);
				} else {
					$count = count($this->collTblusertempscores);
				}
			} else {
				$count = count($this->collTblusertempscores);
			}
		}
		$this->lastTblusertempscoreCriteria = $criteria;
		return $count;
	}

	
	public function addTblusertempscore(Tblusertempscore $l)
	{
		if ($this->collTblusertempscores === null) {
			$this->initTblusertempscores();
		}
		if (!in_array($l, $this->collTblusertempscores, true)) { 			array_push($this->collTblusertempscores, $l);
			$l->setTbluser($this);
		}
	}

	
	public function clearAllReferences($deep = false)
	{
		if ($deep) {
			if ($this->collTblblogs) {
				foreach ((array) $this->collTblblogs as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblblogcategoryentrys) {
				foreach ((array) $this->collTblblogcategoryentrys as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->singleTblblogcheckinfo) {
				$this->singleTblblogcheckinfo->clearAllReferences($deep);
			}
			if ($this->collTblblogentrys) {
				foreach ((array) $this->collTblblogentrys as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblblogentrycomments) {
				foreach ((array) $this->collTblblogentrycomments as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblblogusers) {
				foreach ((array) $this->collTblblogusers as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblbloguserchecks) {
				foreach ((array) $this->collTblbloguserchecks as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblcomplains) {
				foreach ((array) $this->collTblcomplains as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTbldocuments) {
				foreach ((array) $this->collTbldocuments as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblpresentations) {
				foreach ((array) $this->collTblpresentations as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTbluserdayscores) {
				foreach ((array) $this->collTbluserdayscores as $o) {
					$o->clearAllReferences($deep);
				}
			}
			if ($this->collTblusertempscores) {
				foreach ((array) $this->collTblusertempscores as $o) {
					$o->clearAllReferences($deep);
				}
			}
		} 
		$this->collTblblogs = null;
		$this->collTblblogcategoryentrys = null;
		$this->singleTblblogcheckinfo = null;
		$this->collTblblogentrys = null;
		$this->collTblblogentrycomments = null;
		$this->collTblblogusers = null;
		$this->collTblbloguserchecks = null;
		$this->collTblcomplains = null;
		$this->collTbldocuments = null;
		$this->collTblpresentations = null;
		$this->collTbluserdayscores = null;
		$this->collTblusertempscores = null;
	}

} 