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


PHP Criteria::setPrimaryTableName方法代码示例

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


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

示例1: testDoInsert

 public function testDoInsert()
 {
     try {
         $c = new Criteria();
         $c->setPrimaryTableName(BookPeer::TABLE_NAME);
         $c->add(BookPeer::AUTHOR_ID, 'lkhlkhj');
         BasePeer::doInsert($c, Propel::getConnection());
     } catch (PropelException $e) {
         $this->assertContains('[INSERT INTO `book` (`AUTHOR_ID`) VALUES (:p1)]', $e->getMessage(), 'SQL query is written in the exception message');
     }
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:11,代码来源:BasePeerExceptionsTest.php

示例2: doUpdate

	/**
	 * Performs an UPDATE on the database, given a AbsenceEleveTraitement or Criteria object.
	 *
	 * @param      mixed $values Criteria or AbsenceEleveTraitement object containing data that is used to create the UPDATE statement.
	 * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
	 * @return     int The number of affected rows (if supported by underlying database driver).
	 * @throws     PropelException Any exceptions caught during processing will be
	 *		 rethrown wrapped into a PropelException.
	 */
	public static function doUpdate($values, PropelPDO $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(AbsenceEleveTraitementPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}

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

		if ($values instanceof Criteria) {
			$criteria = clone $values; // rename for clarity

			$comparison = $criteria->getComparison(AbsenceEleveTraitementPeer::ID);
			$value = $criteria->remove(AbsenceEleveTraitementPeer::ID);
			if ($value) {
				$selectCriteria->add(AbsenceEleveTraitementPeer::ID, $value, $comparison);
			} else {
				$selectCriteria->setPrimaryTableName(AbsenceEleveTraitementPeer::TABLE_NAME);
			}

		} else { // $values is AbsenceEleveTraitement object
			$criteria = $values->buildCriteria(); // gets full criteria
			$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
		}

		// set the correct dbName
		$criteria->setDbName(self::DATABASE_NAME);

		return BasePeer::doUpdate($selectCriteria, $criteria, $con);
	}
开发者ID:rhertzog,项目名称:lcs,代码行数:38,代码来源:BaseAbsenceEleveTraitementPeer.php

示例3: doUpdate

 /**
  * Performs an UPDATE on the database, given a Traspaso or Criteria object.
  *
  * @param      mixed $values Criteria or Traspaso object containing data that is used to create the UPDATE statement.
  * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
  * @return int             The number of affected rows (if supported by underlying database driver).
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doUpdate($values, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(TraspasoPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $selectCriteria = new Criteria(TraspasoPeer::DATABASE_NAME);
     if ($values instanceof Criteria) {
         $criteria = clone $values;
         // rename for clarity
         $comparison = $criteria->getComparison(TraspasoPeer::IDINVENTARIOLUGAR);
         $value = $criteria->remove(TraspasoPeer::IDINVENTARIOLUGAR);
         if ($value) {
             $selectCriteria->add(TraspasoPeer::IDINVENTARIOLUGAR, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(TraspasoPeer::TABLE_NAME);
         }
         $comparison = $criteria->getComparison(TraspasoPeer::IDLUGARREMITENTE);
         $value = $criteria->remove(TraspasoPeer::IDLUGARREMITENTE);
         if ($value) {
             $selectCriteria->add(TraspasoPeer::IDLUGARREMITENTE, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(TraspasoPeer::TABLE_NAME);
         }
         $comparison = $criteria->getComparison(TraspasoPeer::IDLUGARDESTINATARIO);
         $value = $criteria->remove(TraspasoPeer::IDLUGARDESTINATARIO);
         if ($value) {
             $selectCriteria->add(TraspasoPeer::IDLUGARDESTINATARIO, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(TraspasoPeer::TABLE_NAME);
         }
     } else {
         // $values is Traspaso object
         $criteria = $values->buildCriteria();
         // gets full criteria
         $selectCriteria = $values->buildPkeyCriteria();
         // gets criteria w/ primary key(s)
     }
     // set the correct dbName
     $criteria->setDbName(TraspasoPeer::DATABASE_NAME);
     return BasePeer::doUpdate($selectCriteria, $criteria, $con);
 }
开发者ID:jalvarez14,项目名称:hva,代码行数:50,代码来源:BaseTraspasoPeer.php

示例4: testCommentDoUpdate

 public function testCommentDoUpdate()
 {
     $c1 = new Criteria();
     $c1->setPrimaryTableName(BookPeer::TABLE_NAME);
     $c1->setComment('Foo');
     $c2 = new Criteria();
     $c2->add(BookPeer::TITLE, 'Updated Title');
     $con = Propel::getConnection(BookPeer::DATABASE_NAME);
     BasePeer::doUpdate($c1, $c2, $con);
     $expected = 'UPDATE /* Foo */ `book` SET `TITLE`=\'Updated Title\'';
     $this->assertEquals($expected, $con->getLastExecutedQuery(), 'Criteria::setComment() adds a comment to update queries');
 }
开发者ID:halfer,项目名称:Meshing,代码行数:12,代码来源:BasePeerTest.php

示例5: doUpdate

 /**
  * Method perform an UPDATE on the database, given a SessionRelCourseRelUser or Criteria object.
  *
  * @param      mixed $values Criteria or SessionRelCourseRelUser object containing data that is used to create the UPDATE statement.
  * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
  * @return     int The number of affected rows (if supported by underlying database driver).
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doUpdate($values, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(SessionRelCourseRelUserPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $selectCriteria = new Criteria(self::DATABASE_NAME);
     if ($values instanceof Criteria) {
         $criteria = clone $values;
         // rename for clarity
         $comparison = $criteria->getComparison(SessionRelCourseRelUserPeer::ID_SESSION);
         $value = $criteria->remove(SessionRelCourseRelUserPeer::ID_SESSION);
         if ($value) {
             $selectCriteria->add(SessionRelCourseRelUserPeer::ID_SESSION, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(SessionRelCourseRelUserPeer::TABLE_NAME);
         }
         $comparison = $criteria->getComparison(SessionRelCourseRelUserPeer::COURSE_CODE);
         $value = $criteria->remove(SessionRelCourseRelUserPeer::COURSE_CODE);
         if ($value) {
             $selectCriteria->add(SessionRelCourseRelUserPeer::COURSE_CODE, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(SessionRelCourseRelUserPeer::TABLE_NAME);
         }
         $comparison = $criteria->getComparison(SessionRelCourseRelUserPeer::ID_USER);
         $value = $criteria->remove(SessionRelCourseRelUserPeer::ID_USER);
         if ($value) {
             $selectCriteria->add(SessionRelCourseRelUserPeer::ID_USER, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(SessionRelCourseRelUserPeer::TABLE_NAME);
         }
     } else {
         // $values is SessionRelCourseRelUser object
         $criteria = $values->buildCriteria();
         // gets full criteria
         $selectCriteria = $values->buildPkeyCriteria();
         // gets criteria w/ primary key(s)
     }
     // set the correct dbName
     $criteria->setDbName(self::DATABASE_NAME);
     return BasePeer::doUpdate($selectCriteria, $criteria, $con);
 }
开发者ID:raulito1500,项目名称:mdokeos,代码行数:50,代码来源:BaseSessionRelCourseRelUserPeer.php

示例6: doUpdate

 /**
  * Performs an UPDATE on the database, given a LanguageObjectHistory or Criteria object.
  *
  * @param      mixed $values Criteria or LanguageObjectHistory object containing data that is used to create the UPDATE statement.
  * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
  * @return int             The number of affected rows (if supported by underlying database driver).
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doUpdate($values, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(LanguageObjectHistoryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $selectCriteria = new Criteria(LanguageObjectHistoryPeer::DATABASE_NAME);
     if ($values instanceof Criteria) {
         $criteria = clone $values;
         // rename for clarity
         $comparison = $criteria->getComparison(LanguageObjectHistoryPeer::OBJECT_ID);
         $value = $criteria->remove(LanguageObjectHistoryPeer::OBJECT_ID);
         if ($value) {
             $selectCriteria->add(LanguageObjectHistoryPeer::OBJECT_ID, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(LanguageObjectHistoryPeer::TABLE_NAME);
         }
         $comparison = $criteria->getComparison(LanguageObjectHistoryPeer::LANGUAGE_ID);
         $value = $criteria->remove(LanguageObjectHistoryPeer::LANGUAGE_ID);
         if ($value) {
             $selectCriteria->add(LanguageObjectHistoryPeer::LANGUAGE_ID, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(LanguageObjectHistoryPeer::TABLE_NAME);
         }
         $comparison = $criteria->getComparison(LanguageObjectHistoryPeer::REVISION);
         $value = $criteria->remove(LanguageObjectHistoryPeer::REVISION);
         if ($value) {
             $selectCriteria->add(LanguageObjectHistoryPeer::REVISION, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(LanguageObjectHistoryPeer::TABLE_NAME);
         }
     } else {
         // $values is LanguageObjectHistory object
         $criteria = $values->buildCriteria();
         // gets full criteria
         $selectCriteria = $values->buildPkeyCriteria();
         // gets criteria w/ primary key(s)
     }
     // set the correct dbName
     $criteria->setDbName(LanguageObjectHistoryPeer::DATABASE_NAME);
     return BasePeer::doUpdate($selectCriteria, $criteria, $con);
 }
开发者ID:rapila,项目名称:cms-base,代码行数:50,代码来源:BaseLanguageObjectHistoryPeer.php

示例7: doUpdate

 /**
  * Performs an UPDATE on the database, given a SubscriberGroupMembership or Criteria object.
  *
  * @param      mixed $values Criteria or SubscriberGroupMembership object containing data that is used to create the UPDATE statement.
  * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
  * @return int             The number of affected rows (if supported by underlying database driver).
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doUpdate($values, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(SubscriberGroupMembershipPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $selectCriteria = new Criteria(SubscriberGroupMembershipPeer::DATABASE_NAME);
     if ($values instanceof Criteria) {
         $criteria = clone $values;
         // rename for clarity
         $comparison = $criteria->getComparison(SubscriberGroupMembershipPeer::SUBSCRIBER_ID);
         $value = $criteria->remove(SubscriberGroupMembershipPeer::SUBSCRIBER_ID);
         if ($value) {
             $selectCriteria->add(SubscriberGroupMembershipPeer::SUBSCRIBER_ID, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(SubscriberGroupMembershipPeer::TABLE_NAME);
         }
         $comparison = $criteria->getComparison(SubscriberGroupMembershipPeer::SUBSCRIBER_GROUP_ID);
         $value = $criteria->remove(SubscriberGroupMembershipPeer::SUBSCRIBER_GROUP_ID);
         if ($value) {
             $selectCriteria->add(SubscriberGroupMembershipPeer::SUBSCRIBER_GROUP_ID, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(SubscriberGroupMembershipPeer::TABLE_NAME);
         }
     } else {
         // $values is SubscriberGroupMembership object
         $criteria = $values->buildCriteria();
         // gets full criteria
         $selectCriteria = $values->buildPkeyCriteria();
         // gets criteria w/ primary key(s)
     }
     // set the correct dbName
     $criteria->setDbName(SubscriberGroupMembershipPeer::DATABASE_NAME);
     return BasePeer::doUpdate($selectCriteria, $criteria, $con);
 }
开发者ID:rapila,项目名称:plugin-newsletter,代码行数:43,代码来源:BaseSubscriberGroupMembershipPeer.php

示例8: doUpdate

 /**
  * Performs an UPDATE on the database, given a Proveedoritradeservicio or Criteria object.
  *
  * @param      mixed $values Criteria or Proveedoritradeservicio object containing data that is used to create the UPDATE statement.
  * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
  * @return int             The number of affected rows (if supported by underlying database driver).
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doUpdate($values, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(ProveedoritradeservicioPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $selectCriteria = new Criteria(ProveedoritradeservicioPeer::DATABASE_NAME);
     if ($values instanceof Criteria) {
         $criteria = clone $values;
         // rename for clarity
         $comparison = $criteria->getComparison(ProveedoritradeservicioPeer::IDPROVEEDORITRADESERVICIO);
         $value = $criteria->remove(ProveedoritradeservicioPeer::IDPROVEEDORITRADESERVICIO);
         if ($value) {
             $selectCriteria->add(ProveedoritradeservicioPeer::IDPROVEEDORITRADESERVICIO, $value, $comparison);
         } else {
             $selectCriteria->setPrimaryTableName(ProveedoritradeservicioPeer::TABLE_NAME);
         }
     } else {
         // $values is Proveedoritradeservicio object
         $criteria = $values->buildCriteria();
         // gets full criteria
         $selectCriteria = $values->buildPkeyCriteria();
         // gets criteria w/ primary key(s)
     }
     // set the correct dbName
     $criteria->setDbName(ProveedoritradeservicioPeer::DATABASE_NAME);
     return BasePeer::doUpdate($selectCriteria, $criteria, $con);
 }
开发者ID:vicbaporu,项目名称:ITRADE,代码行数:36,代码来源:BaseProveedoritradeservicioPeer.php


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