当前位置: 首页>>代码示例>>PHP>>正文


PHP Propel::getDefaultDB方法代码示例

本文整理汇总了PHP中Propel::getDefaultDB方法的典型用法代码示例。如果您正苦于以下问题:PHP Propel::getDefaultDB方法的具体用法?PHP Propel::getDefaultDB怎么用?PHP Propel::getDefaultDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Propel的用法示例。


在下文中一共展示了Propel::getDefaultDB方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instanciate

 /**
  * @static
  * @param string $connectionName
  * @return PropelPDO
  */
 public static function instanciate($connectionName)
 {
     $propelConfiguration = Propel::getConfiguration();
     if (isset($propelConfiguration['datasources'][$connectionName]['connection'])) {
         $parameters = $propelConfiguration['datasources'][$connectionName]['connection'];
     } else {
         if (isset($propelConfiguration['datasources'][Propel::getDefaultDB()])) {
             $propelConfiguration['datasources'][$connectionName] = $propelConfiguration['datasources'][Propel::getDefaultDB()];
             Propel::setConfiguration(new PropelConfiguration($propelConfiguration));
             $parameters = $propelConfiguration['datasources'][$connectionName]['connection'];
         } else {
             throw new Exception(sprintf("Unable to find connection parameters for connection '%s'", $connectionName));
         }
     }
     return Propel::initConnection($parameters, $connectionName);
 }
开发者ID:ratibus,项目名称:Crew,代码行数:21,代码来源:PropelPDOFactory.class.php

示例2: doSelectJoinAllExceptAcademicCalendar

 public static function doSelectJoinAllExceptAcademicCalendar(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     LocationPeer::addSelectColumns($c);
     $startcol2 = LocationPeer::NUM_COLUMNS - LocationPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     LocationCategoryPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + LocationCategoryPeer::NUM_COLUMNS;
     LocationConditionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + LocationConditionPeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + DepartmentPeer::NUM_COLUMNS;
     $c->addJoin(LocationPeer::LOCATION_CATEGORY_ID, LocationCategoryPeer::ID);
     $c->addJoin(LocationPeer::LOCATION_CONDITION_ID, LocationConditionPeer::ID);
     $c->addJoin(LocationPeer::DEPARTMENT_ID, DepartmentPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = LocationPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = LocationCategoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getLocationCategory();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initLocations();
             $obj2->addLocation($obj1);
         }
         $omClass = LocationConditionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getLocationCondition();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initLocations();
             $obj3->addLocation($obj1);
         }
         $omClass = DepartmentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getDepartment();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initLocations();
             $obj4->addLocation($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:taryono,项目名称:school,代码行数:82,代码来源:BaseLocationPeer.php

示例3: doSelectJoinAllExceptModifieParUtilisateur

	/**
	 * Selects a collection of AbsenceEleveTraitement objects pre-filled with all related objects except ModifieParUtilisateur.
	 *
	 * @param      Criteria  $criteria
	 * @param      PropelPDO $con
	 * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
	 * @return     array Array of AbsenceEleveTraitement objects.
	 * @throws     PropelException Any exceptions caught during processing will be
	 *		 rethrown wrapped into a PropelException.
	 */
	public static function doSelectJoinAllExceptModifieParUtilisateur(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		$criteria = clone $criteria;

		// Set the correct dbName if it has not been overridden
		// $criteria->getDbName() will return the same object if not set to another value
		// so == check is okay and faster
		if ($criteria->getDbName() == Propel::getDefaultDB()) {
			$criteria->setDbName(self::DATABASE_NAME);
		}

		AbsenceEleveTraitementPeer::addSelectColumns($criteria);
		$startcol2 = AbsenceEleveTraitementPeer::NUM_HYDRATE_COLUMNS;

		AbsenceEleveTypePeer::addSelectColumns($criteria);
		$startcol3 = $startcol2 + AbsenceEleveTypePeer::NUM_HYDRATE_COLUMNS;

		AbsenceEleveMotifPeer::addSelectColumns($criteria);
		$startcol4 = $startcol3 + AbsenceEleveMotifPeer::NUM_HYDRATE_COLUMNS;

		AbsenceEleveJustificationPeer::addSelectColumns($criteria);
		$startcol5 = $startcol4 + AbsenceEleveJustificationPeer::NUM_HYDRATE_COLUMNS;

		$criteria->addJoin(AbsenceEleveTraitementPeer::A_TYPE_ID, AbsenceEleveTypePeer::ID, $join_behavior);

		$criteria->addJoin(AbsenceEleveTraitementPeer::A_MOTIF_ID, AbsenceEleveMotifPeer::ID, $join_behavior);

		$criteria->addJoin(AbsenceEleveTraitementPeer::A_JUSTIFICATION_ID, AbsenceEleveJustificationPeer::ID, $join_behavior);

		// soft_delete behavior
		if (AbsenceEleveTraitementQuery::isSoftDeleteEnabled()) {
			$criteria->add(AbsenceEleveTraitementPeer::DELETED_AT, null, Criteria::ISNULL);
		} else {
			AbsenceEleveTraitementPeer::enableSoftDelete();
		}

		$stmt = BasePeer::doSelect($criteria, $con);
		$results = array();

		while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$key1 = AbsenceEleveTraitementPeer::getPrimaryKeyHashFromRow($row, 0);
			if (null !== ($obj1 = AbsenceEleveTraitementPeer::getInstanceFromPool($key1))) {
				// We no longer rehydrate the object, since this can cause data loss.
				// See http://www.propelorm.org/ticket/509
				// $obj1->hydrate($row, 0, true); // rehydrate
			} else {
				$cls = AbsenceEleveTraitementPeer::getOMClass(false);

				$obj1 = new $cls();
				$obj1->hydrate($row);
				AbsenceEleveTraitementPeer::addInstanceToPool($obj1, $key1);
			} // if obj1 already loaded

				// Add objects for joined AbsenceEleveType rows

				$key2 = AbsenceEleveTypePeer::getPrimaryKeyHashFromRow($row, $startcol2);
				if ($key2 !== null) {
					$obj2 = AbsenceEleveTypePeer::getInstanceFromPool($key2);
					if (!$obj2) {
	
						$cls = AbsenceEleveTypePeer::getOMClass(false);

					$obj2 = new $cls();
					$obj2->hydrate($row, $startcol2);
					AbsenceEleveTypePeer::addInstanceToPool($obj2, $key2);
				} // if $obj2 already loaded

				// Add the $obj1 (AbsenceEleveTraitement) to the collection in $obj2 (AbsenceEleveType)
				$obj2->addAbsenceEleveTraitement($obj1);

			} // if joined row is not null

				// Add objects for joined AbsenceEleveMotif rows

				$key3 = AbsenceEleveMotifPeer::getPrimaryKeyHashFromRow($row, $startcol3);
				if ($key3 !== null) {
					$obj3 = AbsenceEleveMotifPeer::getInstanceFromPool($key3);
					if (!$obj3) {
	
						$cls = AbsenceEleveMotifPeer::getOMClass(false);

					$obj3 = new $cls();
					$obj3->hydrate($row, $startcol3);
					AbsenceEleveMotifPeer::addInstanceToPool($obj3, $key3);
				} // if $obj3 already loaded

				// Add the $obj1 (AbsenceEleveTraitement) to the collection in $obj3 (AbsenceEleveMotif)
				$obj3->addAbsenceEleveTraitement($obj1);

			} // if joined row is not null
//.........这里部分代码省略.........
开发者ID:rhertzog,项目名称:lcs,代码行数:101,代码来源:BaseAbsenceEleveTraitementPeer.php

示例4: doSelectJoinAll

 public static function doSelectJoinAll(Criteria $c, $con = null)
 {
     foreach (sfMixer::getCallables('BasenahoWikiPagePeer:doSelectJoinAll:doSelectJoinAll') as $callable) {
         call_user_func($callable, 'BasenahoWikiPagePeer', $c, $con);
     }
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     nahoWikiPagePeer::addSelectColumns($c);
     $startcol2 = nahoWikiPagePeer::NUM_COLUMNS - nahoWikiPagePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     nahoWikiWikiPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + nahoWikiWikiPeer::NUM_COLUMNS;
     $c->addJoin(nahoWikiPagePeer::WIKI_ID, nahoWikiWikiPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = nahoWikiPagePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = nahoWikiWikiPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getnahoWikiWiki();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addnahoWikiPage($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initnahoWikiPages();
             $obj2->addnahoWikiPage($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:sgrove,项目名称:cothinker,代码行数:43,代码来源:BasenahoWikiPagePeer.php

示例5: doSelectJoinAllExceptCampus

 public static function doSelectJoinAllExceptCampus(Criteria $c, $con = null)
 {
     foreach (sfMixer::getCallables('BaseProjectApplicationPeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable) {
         call_user_func($callable, 'BaseProjectApplicationPeer', $c, $con);
     }
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     ProjectApplicationPeer::addSelectColumns($c);
     $startcol2 = ProjectApplicationPeer::NUM_COLUMNS - ProjectApplicationPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     sfGuardUserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + sfGuardUserPeer::NUM_COLUMNS;
     sfGuardUserPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + sfGuardUserPeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + DepartmentPeer::NUM_COLUMNS;
     $c->addJoin(ProjectApplicationPeer::CREATED_BY, sfGuardUserPeer::ID);
     $c->addJoin(ProjectApplicationPeer::OWNER_ID, sfGuardUserPeer::ID);
     $c->addJoin(ProjectApplicationPeer::DEPARTMENT_ID, DepartmentPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = ProjectApplicationPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = sfGuardUserPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getsfGuardUserRelatedByCreatedBy();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addProjectApplicationRelatedByCreatedBy($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initProjectApplicationsRelatedByCreatedBy();
             $obj2->addProjectApplicationRelatedByCreatedBy($obj1);
         }
         $omClass = sfGuardUserPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getsfGuardUserRelatedByOwnerId();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addProjectApplicationRelatedByOwnerId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initProjectApplicationsRelatedByOwnerId();
             $obj3->addProjectApplicationRelatedByOwnerId($obj1);
         }
         $omClass = DepartmentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getDepartment();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addProjectApplication($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initProjectApplications();
             $obj4->addProjectApplication($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:sgrove,项目名称:cothinker,代码行数:85,代码来源:BaseProjectApplicationPeer.php

示例6: doSelectJoinAllExceptModuleHook

 /**
  * Selects a collection of Module objects pre-filled with all related objects except ModuleHook.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Module objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptModuleHook(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     ModulePeer::addSelectColumns($c);
     $startcol2 = ModulePeer::NUM_COLUMNS - ModulePeer::NUM_LAZY_LOAD_COLUMNS;
     AddOnPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (AddOnPeer::NUM_COLUMNS - AddOnPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(ModulePeer::ADD_ON), array(AddOnPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = ModulePeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = ModulePeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = ModulePeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             ModulePeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined AddOn rows
         $key2 = AddOnPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = AddOnPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = AddOnPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 AddOnPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Module) to the collection in $obj2 (AddOn)
             $obj2->addModule($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
开发者ID:Evolix,项目名称:lilac,代码行数:61,代码来源:BaseModulePeer.php

示例7: doSelectJoinAll

 public static function doSelectJoinAll(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     SmCheckPeer::addSelectColumns($c);
     $startcol2 = SmCheckPeer::NUM_COLUMNS - SmCheckPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     SmTemplatePeer::addSelectColumns($c);
     $startcol3 = $startcol2 + SmTemplatePeer::NUM_COLUMNS;
     $c->addJoin(SmCheckPeer::SM_TEMPLATE_ID, SmTemplatePeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = SmCheckPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = SmTemplatePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getSmTemplate();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addSmCheck($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initSmChecks();
             $obj2->addSmCheck($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:taryono,项目名称:school,代码行数:40,代码来源:BaseSmCheckPeer.php

示例8: doSelectJoinAllExceptChart

 /**
  * Selects a collection of Job objects pre-filled with all related objects except Chart.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return array           Array of Job objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptChart(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     // $criteria->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(JobPeer::DATABASE_NAME);
     }
     JobPeer::addSelectColumns($criteria);
     $startcol2 = JobPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + UserPeer::NUM_HYDRATE_COLUMNS;
     $criteria->addJoin(JobPeer::USER_ID, UserPeer::ID, $join_behavior);
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = JobPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = JobPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://www.propelorm.org/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = JobPeer::getOMClass();
             $obj1 = new $cls();
             $obj1->hydrate($row);
             JobPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined User rows
         $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = UserPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = UserPeer::getOMClass();
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 UserPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Job) to the collection in $obj2 (User)
             $obj2->addJob($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
开发者ID:Halfnhav4,项目名称:datawrapper,代码行数:59,代码来源:BaseJobPeer.php

示例9: doSelectWithI18n

 /**
  * Selects a collection of {@link Product} objects with a {@link ProductI18n} translation populated.
  *
  * @param Criteria  $criteria
  * @param string    $culture
  * @param PropelPDO $con
  * @param string    $join_behavior
  *
  * @return array
  */
 public static function doSelectWithI18n(Criteria $criteria, $culture = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     if (null === $culture) {
         $culture = sfPropel::getDefaultCulture();
     }
     // Set the correct dbName if it has not been overridden
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(self::DATABASE_NAME);
     }
     ProductPeer::addSelectColumns($criteria);
     $startcol = ProductPeer::NUM_COLUMNS - ProductPeer::NUM_LAZY_LOAD_COLUMNS;
     ProductI18nPeer::addSelectColumns($criteria);
     $criteria->addJoin(ProductPeer::ID, ProductI18nPeer::ID, $join_behavior);
     $criteria->add(ProductI18nPeer::CULTURE, $culture);
     foreach (sfMixer::getCallables('BaseProduct:doSelectJoin:doSelectJoin') as $sf_hook) {
         call_user_func($sf_hook, 'Product', $criteria, $con);
     }
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = ProductPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = ProductPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = ProductPeer::getOMClass(false);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             ProductPeer::addInstanceToPool($obj1, $key1);
         }
         // if $obj1 already loaded
         $key2 = ProductI18nPeer::getPrimaryKeyHashFromRow($row, $startcol);
         if ($key2 !== null) {
             $obj2 = ProductI18nPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = ProductI18nPeer::getOMClass(false);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol);
                 ProductI18nPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 already loaded
             $obj1->setTranslationForCulture($obj2, $culture);
         }
         // if joined row was not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
开发者ID:Tony-M,项目名称:GrannySymfony,代码行数:61,代码来源:BaseProductPeer.php

示例10: doSelectJoinAllExceptColLocation

 public static function doSelectJoinAllExceptColLocation(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VOpacPeer::addSelectColumns($c);
     $startcol2 = VOpacPeer::NUM_COLUMNS - VOpacPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     CatalogPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + CatalogPeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS;
     CatCategoryPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + CatCategoryPeer::NUM_COLUMNS;
     ColStatusPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + ColStatusPeer::NUM_COLUMNS;
     $c->addJoin(VOpacPeer::CATALOG_ID, CatalogPeer::ID);
     $c->addJoin(VOpacPeer::DEPARTMENT_ID, DepartmentPeer::ID);
     $c->addJoin(VOpacPeer::CAT_CATEGORY_ID, CatCategoryPeer::ID);
     $c->addJoin(VOpacPeer::COL_STATUS_ID, ColStatusPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VOpacPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = CatalogPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getCatalog();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVOpac($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVOpacs();
             $obj2->addVOpac($obj1);
         }
         $omClass = DepartmentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getDepartment();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVOpac($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVOpacs();
             $obj3->addVOpac($obj1);
         }
         $omClass = CatCategoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getCatCategory();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVOpac($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVOpacs();
             $obj4->addVOpac($obj1);
         }
         $omClass = ColStatusPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj5 = new $cls();
         $obj5->hydrate($rs, $startcol5);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj5 = $temp_obj1->getColStatus();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addVOpac($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initVOpacs();
             $obj5->addVOpac($obj1);
         }
         $results[] = $obj1;
//.........这里部分代码省略.........
开发者ID:taryono,项目名称:school,代码行数:101,代码来源:BaseVOpacPeer.php

示例11: doSelectJoinAllExceptUser

 public static function doSelectJoinAllExceptUser(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     AnswerPeer::addSelectColumns($c);
     $startcol2 = AnswerPeer::NUM_COLUMNS - AnswerPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     QuestionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + QuestionPeer::NUM_COLUMNS;
     $c->addJoin(AnswerPeer::QUESTION_ID, QuestionPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = AnswerPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = QuestionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getQuestion();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addAnswer($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initAnswers();
             $obj2->addAnswer($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:emacsattic,项目名称:symfony,代码行数:40,代码来源:BaseAnswerPeer.php

示例12: doSelectJoinAllExceptTalent

 public static function doSelectJoinAllExceptTalent(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TestApplicantAchievementPeer::addSelectColumns($c);
     $startcol2 = TestApplicantAchievementPeer::NUM_COLUMNS - TestApplicantAchievementPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     TestApplicantPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + TestApplicantPeer::NUM_COLUMNS;
     $c->addJoin(TestApplicantAchievementPeer::TEST_APPLICANT_ID, TestApplicantPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = TestApplicantAchievementPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = TestApplicantPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getTestApplicant();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addTestApplicantAchievement($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initTestApplicantAchievements();
             $obj2->addTestApplicantAchievement($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:taryono,项目名称:school,代码行数:40,代码来源:BaseTestApplicantAchievementPeer.php

示例13: doSelectJoinAllExceptCourseSchedule

 public static function doSelectJoinAllExceptCourseSchedule(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     CourseScheduleTutorPeer::addSelectColumns($c);
     $startcol2 = CourseScheduleTutorPeer::NUM_COLUMNS - CourseScheduleTutorPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     EmployeePeer::addSelectColumns($c);
     $startcol3 = $startcol2 + EmployeePeer::NUM_COLUMNS;
     $c->addJoin(CourseScheduleTutorPeer::EMPLOYEE_ID, EmployeePeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = CourseScheduleTutorPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = EmployeePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getEmployee();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addCourseScheduleTutor($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initCourseScheduleTutors();
             $obj2->addCourseScheduleTutor($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:taryono,项目名称:school,代码行数:40,代码来源:BaseCourseScheduleTutorPeer.php

示例14: doSelectJoinAllExceptAcademicCost

 public static function doSelectJoinAllExceptAcademicCost(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     PaymentHistoryPeer::addSelectColumns($c);
     $startcol2 = PaymentHistoryPeer::NUM_COLUMNS - PaymentHistoryPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     PaymentJournalPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + PaymentJournalPeer::NUM_COLUMNS;
     $c->addJoin(PaymentHistoryPeer::PAYMENT_JOURNAL_ID, PaymentJournalPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = PaymentHistoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = PaymentJournalPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getPaymentJournal();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addPaymentHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initPaymentHistorys();
             $obj2->addPaymentHistory($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:taryono,项目名称:school,代码行数:40,代码来源:BasePaymentHistoryPeer.php

示例15: doSelectJoinAllExceptCur13TermSpec

 public static function doSelectJoinAllExceptCur13TermSpec(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     Cur13GradePeer::addSelectColumns($c);
     $startcol2 = Cur13GradePeer::NUM_COLUMNS - Cur13GradePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     StudentAccalPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + StudentAccalPeer::NUM_COLUMNS;
     $c->addJoin(Cur13GradePeer::STUDENT_ACCAL_ID, StudentAccalPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = Cur13GradePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = StudentAccalPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getStudentAccal();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addCur13Grade($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initCur13Grades();
             $obj2->addCur13Grade($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
开发者ID:taryono,项目名称:school,代码行数:40,代码来源:BaseCur13GradePeer.php


注:本文中的Propel::getDefaultDB方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。