<?php


abstract class BaseTblscormcminodePeer {

	
	const DATABASE_NAME = 'propel';

	
	const TABLE_NAME = 'tblscormcminode';

	
	const CLASS_DEFAULT = 'lib.model.Tblscormcminode';

	
	const NUM_COLUMNS = 44;

	
	const NUM_LAZY_LOAD_COLUMNS = 0;

	
	const ACCESSCOUNT = 'tblscormcminode.ACCESSCOUNT';

	
	const ACCESSDURATION = 'tblscormcminode.ACCESSDURATION';

	
	const ACCESSED = 'tblscormcminode.ACCESSED';

	
	const ACTIVITYABSDURATION = 'tblscormcminode.ACTIVITYABSDURATION';

	
	const ACTIVITYATTEMPTCOUNT = 'tblscormcminode.ACTIVITYATTEMPTCOUNT';

	
	const ACTIVITYEXPDURATION = 'tblscormcminode.ACTIVITYEXPDURATION';

	
	const ACTIVITYPROGSTATUS = 'tblscormcminode.ACTIVITYPROGSTATUS';

	
	const ATTEMPTABSDURATION = 'tblscormcminode.ATTEMPTABSDURATION';

	
	const ATTEMPTCOMPLAMOUNT = 'tblscormcminode.ATTEMPTCOMPLAMOUNT';

	
	const ATTEMPTCOMPLSTATUS = 'tblscormcminode.ATTEMPTCOMPLSTATUS';

	
	const ATTEMPTEXPDURATION = 'tblscormcminode.ATTEMPTEXPDURATION';

	
	const ATTEMPTPROGSTATUS = 'tblscormcminode.ATTEMPTPROGSTATUS';

	
	const AUDIO_CAPTIONING = 'tblscormcminode.AUDIO_CAPTIONING';

	
	const AUDIO_LEVEL = 'tblscormcminode.AUDIO_LEVEL';

	
	const AVAILABLECHILDREN = 'tblscormcminode.AVAILABLECHILDREN';

	
	const CMI_NODE_ID = 'tblscormcminode.CMI_NODE_ID';

	
	const COMPLETION = 'tblscormcminode.COMPLETION';

	
	const COMPLETION_STATUS = 'tblscormcminode.COMPLETION_STATUS';

	
	const COMPLETION_THRESHOLD = 'tblscormcminode.COMPLETION_THRESHOLD';

	
	const CP_NODE_ID = 'tblscormcminode.CP_NODE_ID';

	
	const CREATED = 'tblscormcminode.CREATED';

	
	const CREDIT = 'tblscormcminode.CREDIT';

	
	const DELIVERY_SPEED = 'tblscormcminode.DELIVERY_SPEED';

	
	const C_ENTRY = 'tblscormcminode.C_ENTRY';

	
	const C_EXIT = 'tblscormcminode.C_EXIT';

	
	const C_LANGUAGE = 'tblscormcminode.C_LANGUAGE';

	
	const LAUNCH_DATA = 'tblscormcminode.LAUNCH_DATA';

	
	const LEARNER_NAME = 'tblscormcminode.LEARNER_NAME';

	
	const LOCATION = 'tblscormcminode.LOCATION';

	
	const C_MAX = 'tblscormcminode.C_MAX';

	
	const C_MIN = 'tblscormcminode.C_MIN';

	
	const C_MODE = 'tblscormcminode.C_MODE';

	
	const MODIFIED = 'tblscormcminode.MODIFIED';

	
	const PROGRESS_MEASURE = 'tblscormcminode.PROGRESS_MEASURE';

	
	const C_RAW = 'tblscormcminode.C_RAW';

	
	const SCALED = 'tblscormcminode.SCALED';

	
	const SCALED_PASSING_SCORE = 'tblscormcminode.SCALED_PASSING_SCORE';

	
	const SESSION_TIME = 'tblscormcminode.SESSION_TIME';

	
	const SUCCESS_STATUS = 'tblscormcminode.SUCCESS_STATUS';

	
	const SUSPEND_DATA = 'tblscormcminode.SUSPEND_DATA';

	
	const TOTAL_TIME = 'tblscormcminode.TOTAL_TIME';

	
	const USER_ID = 'tblscormcminode.USER_ID';

	
	const C_TIMESTAMP = 'tblscormcminode.C_TIMESTAMP';

	
	const ADDITIONAL_TABLES = 'tblscormcminode.ADDITIONAL_TABLES';

	
	public static $instances = array();

	
	private static $mapBuilder = null;

	
	private static $fieldNames = array (
		BasePeer::TYPE_PHPNAME => array ('Accesscount', 'Accessduration', 'Accessed', 'Activityabsduration', 'Activityattemptcount', 'Activityexpduration', 'Activityprogstatus', 'Attemptabsduration', 'Attemptcomplamount', 'Attemptcomplstatus', 'Attemptexpduration', 'Attemptprogstatus', 'AudioCaptioning', 'AudioLevel', 'Availablechildren', 'CmiNodeId', 'Completion', 'CompletionStatus', 'CompletionThreshold', 'CpNodeId', 'Created', 'Credit', 'DeliverySpeed', 'CEntry', 'CExit', 'CLanguage', 'LaunchData', 'LearnerName', 'Location', 'CMax', 'CMin', 'CMode', 'Modified', 'ProgressMeasure', 'CRaw', 'Scaled', 'ScaledPassingScore', 'SessionTime', 'SuccessStatus', 'SuspendData', 'TotalTime', 'UserId', 'CTimestamp', 'AdditionalTables', ),
		BasePeer::TYPE_STUDLYPHPNAME => array ('accesscount', 'accessduration', 'accessed', 'activityabsduration', 'activityattemptcount', 'activityexpduration', 'activityprogstatus', 'attemptabsduration', 'attemptcomplamount', 'attemptcomplstatus', 'attemptexpduration', 'attemptprogstatus', 'audioCaptioning', 'audioLevel', 'availablechildren', 'cmiNodeId', 'completion', 'completionStatus', 'completionThreshold', 'cpNodeId', 'created', 'credit', 'deliverySpeed', 'cEntry', 'cExit', 'cLanguage', 'launchData', 'learnerName', 'location', 'cMax', 'cMin', 'cMode', 'modified', 'progressMeasure', 'cRaw', 'scaled', 'scaledPassingScore', 'sessionTime', 'successStatus', 'suspendData', 'totalTime', 'userId', 'cTimestamp', 'additionalTables', ),
		BasePeer::TYPE_COLNAME => array (self::ACCESSCOUNT, self::ACCESSDURATION, self::ACCESSED, self::ACTIVITYABSDURATION, self::ACTIVITYATTEMPTCOUNT, self::ACTIVITYEXPDURATION, self::ACTIVITYPROGSTATUS, self::ATTEMPTABSDURATION, self::ATTEMPTCOMPLAMOUNT, self::ATTEMPTCOMPLSTATUS, self::ATTEMPTEXPDURATION, self::ATTEMPTPROGSTATUS, self::AUDIO_CAPTIONING, self::AUDIO_LEVEL, self::AVAILABLECHILDREN, self::CMI_NODE_ID, self::COMPLETION, self::COMPLETION_STATUS, self::COMPLETION_THRESHOLD, self::CP_NODE_ID, self::CREATED, self::CREDIT, self::DELIVERY_SPEED, self::C_ENTRY, self::C_EXIT, self::C_LANGUAGE, self::LAUNCH_DATA, self::LEARNER_NAME, self::LOCATION, self::C_MAX, self::C_MIN, self::C_MODE, self::MODIFIED, self::PROGRESS_MEASURE, self::C_RAW, self::SCALED, self::SCALED_PASSING_SCORE, self::SESSION_TIME, self::SUCCESS_STATUS, self::SUSPEND_DATA, self::TOTAL_TIME, self::USER_ID, self::C_TIMESTAMP, self::ADDITIONAL_TABLES, ),
		BasePeer::TYPE_FIELDNAME => array ('accesscount', 'accessduration', 'accessed', 'activityabsduration', 'activityattemptcount', 'activityexpduration', 'activityprogstatus', 'attemptabsduration', 'attemptcomplamount', 'attemptcomplstatus', 'attemptexpduration', 'attemptprogstatus', 'audio_captioning', 'audio_level', 'availablechildren', 'cmi_node_id', 'completion', 'completion_status', 'completion_threshold', 'cp_node_id', 'created', 'credit', 'delivery_speed', 'c_entry', 'c_exit', 'c_language', 'launch_data', 'learner_name', 'location', 'c_max', 'c_min', 'c_mode', 'modified', 'progress_measure', 'c_raw', 'scaled', 'scaled_passing_score', 'session_time', 'success_status', 'suspend_data', 'total_time', 'user_id', 'c_timestamp', 'additional_tables', ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, )
	);

	
	private static $fieldKeys = array (
		BasePeer::TYPE_PHPNAME => array ('Accesscount' => 0, 'Accessduration' => 1, 'Accessed' => 2, 'Activityabsduration' => 3, 'Activityattemptcount' => 4, 'Activityexpduration' => 5, 'Activityprogstatus' => 6, 'Attemptabsduration' => 7, 'Attemptcomplamount' => 8, 'Attemptcomplstatus' => 9, 'Attemptexpduration' => 10, 'Attemptprogstatus' => 11, 'AudioCaptioning' => 12, 'AudioLevel' => 13, 'Availablechildren' => 14, 'CmiNodeId' => 15, 'Completion' => 16, 'CompletionStatus' => 17, 'CompletionThreshold' => 18, 'CpNodeId' => 19, 'Created' => 20, 'Credit' => 21, 'DeliverySpeed' => 22, 'CEntry' => 23, 'CExit' => 24, 'CLanguage' => 25, 'LaunchData' => 26, 'LearnerName' => 27, 'Location' => 28, 'CMax' => 29, 'CMin' => 30, 'CMode' => 31, 'Modified' => 32, 'ProgressMeasure' => 33, 'CRaw' => 34, 'Scaled' => 35, 'ScaledPassingScore' => 36, 'SessionTime' => 37, 'SuccessStatus' => 38, 'SuspendData' => 39, 'TotalTime' => 40, 'UserId' => 41, 'CTimestamp' => 42, 'AdditionalTables' => 43, ),
		BasePeer::TYPE_STUDLYPHPNAME => array ('accesscount' => 0, 'accessduration' => 1, 'accessed' => 2, 'activityabsduration' => 3, 'activityattemptcount' => 4, 'activityexpduration' => 5, 'activityprogstatus' => 6, 'attemptabsduration' => 7, 'attemptcomplamount' => 8, 'attemptcomplstatus' => 9, 'attemptexpduration' => 10, 'attemptprogstatus' => 11, 'audioCaptioning' => 12, 'audioLevel' => 13, 'availablechildren' => 14, 'cmiNodeId' => 15, 'completion' => 16, 'completionStatus' => 17, 'completionThreshold' => 18, 'cpNodeId' => 19, 'created' => 20, 'credit' => 21, 'deliverySpeed' => 22, 'cEntry' => 23, 'cExit' => 24, 'cLanguage' => 25, 'launchData' => 26, 'learnerName' => 27, 'location' => 28, 'cMax' => 29, 'cMin' => 30, 'cMode' => 31, 'modified' => 32, 'progressMeasure' => 33, 'cRaw' => 34, 'scaled' => 35, 'scaledPassingScore' => 36, 'sessionTime' => 37, 'successStatus' => 38, 'suspendData' => 39, 'totalTime' => 40, 'userId' => 41, 'cTimestamp' => 42, 'additionalTables' => 43, ),
		BasePeer::TYPE_COLNAME => array (self::ACCESSCOUNT => 0, self::ACCESSDURATION => 1, self::ACCESSED => 2, self::ACTIVITYABSDURATION => 3, self::ACTIVITYATTEMPTCOUNT => 4, self::ACTIVITYEXPDURATION => 5, self::ACTIVITYPROGSTATUS => 6, self::ATTEMPTABSDURATION => 7, self::ATTEMPTCOMPLAMOUNT => 8, self::ATTEMPTCOMPLSTATUS => 9, self::ATTEMPTEXPDURATION => 10, self::ATTEMPTPROGSTATUS => 11, self::AUDIO_CAPTIONING => 12, self::AUDIO_LEVEL => 13, self::AVAILABLECHILDREN => 14, self::CMI_NODE_ID => 15, self::COMPLETION => 16, self::COMPLETION_STATUS => 17, self::COMPLETION_THRESHOLD => 18, self::CP_NODE_ID => 19, self::CREATED => 20, self::CREDIT => 21, self::DELIVERY_SPEED => 22, self::C_ENTRY => 23, self::C_EXIT => 24, self::C_LANGUAGE => 25, self::LAUNCH_DATA => 26, self::LEARNER_NAME => 27, self::LOCATION => 28, self::C_MAX => 29, self::C_MIN => 30, self::C_MODE => 31, self::MODIFIED => 32, self::PROGRESS_MEASURE => 33, self::C_RAW => 34, self::SCALED => 35, self::SCALED_PASSING_SCORE => 36, self::SESSION_TIME => 37, self::SUCCESS_STATUS => 38, self::SUSPEND_DATA => 39, self::TOTAL_TIME => 40, self::USER_ID => 41, self::C_TIMESTAMP => 42, self::ADDITIONAL_TABLES => 43, ),
		BasePeer::TYPE_FIELDNAME => array ('accesscount' => 0, 'accessduration' => 1, 'accessed' => 2, 'activityabsduration' => 3, 'activityattemptcount' => 4, 'activityexpduration' => 5, 'activityprogstatus' => 6, 'attemptabsduration' => 7, 'attemptcomplamount' => 8, 'attemptcomplstatus' => 9, 'attemptexpduration' => 10, 'attemptprogstatus' => 11, 'audio_captioning' => 12, 'audio_level' => 13, 'availablechildren' => 14, 'cmi_node_id' => 15, 'completion' => 16, 'completion_status' => 17, 'completion_threshold' => 18, 'cp_node_id' => 19, 'created' => 20, 'credit' => 21, 'delivery_speed' => 22, 'c_entry' => 23, 'c_exit' => 24, 'c_language' => 25, 'launch_data' => 26, 'learner_name' => 27, 'location' => 28, 'c_max' => 29, 'c_min' => 30, 'c_mode' => 31, 'modified' => 32, 'progress_measure' => 33, 'c_raw' => 34, 'scaled' => 35, 'scaled_passing_score' => 36, 'session_time' => 37, 'success_status' => 38, 'suspend_data' => 39, 'total_time' => 40, 'user_id' => 41, 'c_timestamp' => 42, 'additional_tables' => 43, ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, )
	);

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

	

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

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

	
	public static function addSelectColumns(Criteria $criteria)
	{

		$criteria->addSelectColumn(TblscormcminodePeer::ACCESSCOUNT);

		$criteria->addSelectColumn(TblscormcminodePeer::ACCESSDURATION);

		$criteria->addSelectColumn(TblscormcminodePeer::ACCESSED);

		$criteria->addSelectColumn(TblscormcminodePeer::ACTIVITYABSDURATION);

		$criteria->addSelectColumn(TblscormcminodePeer::ACTIVITYATTEMPTCOUNT);

		$criteria->addSelectColumn(TblscormcminodePeer::ACTIVITYEXPDURATION);

		$criteria->addSelectColumn(TblscormcminodePeer::ACTIVITYPROGSTATUS);

		$criteria->addSelectColumn(TblscormcminodePeer::ATTEMPTABSDURATION);

		$criteria->addSelectColumn(TblscormcminodePeer::ATTEMPTCOMPLAMOUNT);

		$criteria->addSelectColumn(TblscormcminodePeer::ATTEMPTCOMPLSTATUS);

		$criteria->addSelectColumn(TblscormcminodePeer::ATTEMPTEXPDURATION);

		$criteria->addSelectColumn(TblscormcminodePeer::ATTEMPTPROGSTATUS);

		$criteria->addSelectColumn(TblscormcminodePeer::AUDIO_CAPTIONING);

		$criteria->addSelectColumn(TblscormcminodePeer::AUDIO_LEVEL);

		$criteria->addSelectColumn(TblscormcminodePeer::AVAILABLECHILDREN);

		$criteria->addSelectColumn(TblscormcminodePeer::CMI_NODE_ID);

		$criteria->addSelectColumn(TblscormcminodePeer::COMPLETION);

		$criteria->addSelectColumn(TblscormcminodePeer::COMPLETION_STATUS);

		$criteria->addSelectColumn(TblscormcminodePeer::COMPLETION_THRESHOLD);

		$criteria->addSelectColumn(TblscormcminodePeer::CP_NODE_ID);

		$criteria->addSelectColumn(TblscormcminodePeer::CREATED);

		$criteria->addSelectColumn(TblscormcminodePeer::CREDIT);

		$criteria->addSelectColumn(TblscormcminodePeer::DELIVERY_SPEED);

		$criteria->addSelectColumn(TblscormcminodePeer::C_ENTRY);

		$criteria->addSelectColumn(TblscormcminodePeer::C_EXIT);

		$criteria->addSelectColumn(TblscormcminodePeer::C_LANGUAGE);

		$criteria->addSelectColumn(TblscormcminodePeer::LAUNCH_DATA);

		$criteria->addSelectColumn(TblscormcminodePeer::LEARNER_NAME);

		$criteria->addSelectColumn(TblscormcminodePeer::LOCATION);

		$criteria->addSelectColumn(TblscormcminodePeer::C_MAX);

		$criteria->addSelectColumn(TblscormcminodePeer::C_MIN);

		$criteria->addSelectColumn(TblscormcminodePeer::C_MODE);

		$criteria->addSelectColumn(TblscormcminodePeer::MODIFIED);

		$criteria->addSelectColumn(TblscormcminodePeer::PROGRESS_MEASURE);

		$criteria->addSelectColumn(TblscormcminodePeer::C_RAW);

		$criteria->addSelectColumn(TblscormcminodePeer::SCALED);

		$criteria->addSelectColumn(TblscormcminodePeer::SCALED_PASSING_SCORE);

		$criteria->addSelectColumn(TblscormcminodePeer::SESSION_TIME);

		$criteria->addSelectColumn(TblscormcminodePeer::SUCCESS_STATUS);

		$criteria->addSelectColumn(TblscormcminodePeer::SUSPEND_DATA);

		$criteria->addSelectColumn(TblscormcminodePeer::TOTAL_TIME);

		$criteria->addSelectColumn(TblscormcminodePeer::USER_ID);

		$criteria->addSelectColumn(TblscormcminodePeer::C_TIMESTAMP);

		$criteria->addSelectColumn(TblscormcminodePeer::ADDITIONAL_TABLES);

	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		$criteria->addJoin(array(TblscormcminodePeer::CP_NODE_ID,), array(TblscormcpnodePeer::CP_NODE_ID,), $join_behavior);
		$stmt = BasePeer::doCount($criteria, $con);

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


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

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

		TblscormcminodePeer::addSelectColumns($c);
		$startcol = (TblscormcminodePeer::NUM_COLUMNS - TblscormcminodePeer::NUM_LAZY_LOAD_COLUMNS);
		TblscormcpnodePeer::addSelectColumns($c);

		$c->addJoin(array(TblscormcminodePeer::CP_NODE_ID,), array(TblscormcpnodePeer::CP_NODE_ID,), $join_behavior);
		$stmt = BasePeer::doSelect($c, $con);
		$results = array();

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

				$omClass = TblscormcminodePeer::getOMClass();

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

					$omClass = TblscormcpnodePeer::getOMClass();

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

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


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

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

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

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

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

		$criteria->addJoin(array(TblscormcminodePeer::CP_NODE_ID,), array(TblscormcpnodePeer::CP_NODE_ID,), $join_behavior);
		$stmt = BasePeer::doCount($criteria, $con);

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

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

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

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

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

		$c->addJoin(array(TblscormcminodePeer::CP_NODE_ID,), array(TblscormcpnodePeer::CP_NODE_ID,), $join_behavior);
		$stmt = BasePeer::doSelect($c, $con);
		$results = array();

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

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

					$omClass = TblscormcpnodePeer::getOMClass();


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

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

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

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

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

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


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

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

		return $pk;
	}

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

		}

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

    return $res;
	}

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

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

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

		$criteria = new Criteria(TblscormcminodePeer::DATABASE_NAME);
		$criteria->add(TblscormcminodePeer::CMI_NODE_ID, $pk);

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

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

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

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

} 

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

