• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP BasePeer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: delete

 public function delete(PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(sfGuardGroupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     if ($this->isDefaultGroup()) {
         throw new sfException('Cannot remove default group (ID ' . $this->id . ')!');
         return false;
     }
     /*
      * get default group
      *
      */
     $default_group = sfGuardGroupPeer::getDefaultGroup();
     //get default group
     /*
      * check if servers has this group
      * If servers found remove reference to group to be deleted
      */
     $con->beginTransaction();
     try {
         //select from...
         $c1 = new Criteria();
         $c1->add(EtvaServerPeer::SF_GUARD_GROUP_ID, $this->getId());
         //update set
         $c2 = new Criteria();
         $c2->add(EtvaServerPeer::SF_GUARD_GROUP_ID, $default_group->getId());
         BasePeer::doUpdate($c1, $c2, $con);
         parent::delete($con);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollBack();
         throw $e;
     }
 }
开发者ID:ketheriel,项目名称:ETVA,代码行数:35,代码来源:sfGuardGroup.php


示例2: doUpdateAllModerations

 public static function doUpdateAllModerations($selectCriteria, $values, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     return BasePeer::doUpdate($selectCriteria, $values, $con);
 }
开发者ID:DBezemer,项目名称:server,代码行数:7,代码来源:moderationPeer.php


示例3: assertCriteriaTranslation

 protected function assertCriteriaTranslation($criteria, $expectedSql, $expectedParams, $message = '')
 {
     $params = array();
     $result = BasePeer::createSelectSql($criteria, $params);
     $this->assertEquals($expectedSql, $result, $message);
     $this->assertEquals($expectedParams, $params, $message);
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:7,代码来源:ModelCriteriaWithSchemaTest.php


示例4: execute

 protected function execute($arguments = array(), $options = array())
 {
     $context = sfContext::createInstance(sfProjectConfiguration::getApplicationConfiguration('app', 'dev', true));
     parent::execute($arguments, $options);
     // initialize the database connection
     $databaseManager = new sfDatabaseManager($this->configuration);
     $con = $databaseManager->getDatabase($options['connection'])->getConnection();
     // add your code here
     $this->log('[INFO] Checking VirtAgents state...' . "\n");
     $offset = sfConfig::get('app_node_keepalive_update') + sfConfig::get('app_node_keepalive_update_offset');
     $total_nodes = EtvaNodePeer::doCount(new Criteria());
     if ($total_nodes > 0) {
         $con->beginTransaction();
         $affected = 0;
         try {
             $offset_date = date("c", time() - $offset);
             /*
              * get nodes that have last_keepalive field outdated
              */
             $c1 = new Criteria();
             $c1->add(EtvaNodePeer::LAST_KEEPALIVE, $offset_date, Criteria::LESS_THAN);
             $c1->add(EtvaNodePeer::STATE, EtvaNode::NODE_ACTIVE);
             // only active
             //update statement
             $c2 = new Criteria();
             $c2->add(EtvaNodePeer::STATE, EtvaNode::NODE_INACTIVE);
             $affected += BasePeer::doUpdate($c1, $c2, $con);
             // update maintenance and running to maintenance
             $c1 = new Criteria();
             $c1->add(EtvaNodePeer::LAST_KEEPALIVE, $offset_date, Criteria::LESS_THAN);
             $c1->add(EtvaNodePeer::STATE, EtvaNode::NODE_MAINTENANCE_UP);
             //update statement
             $c2 = new Criteria();
             $c2->add(EtvaNodePeer::STATE, EtvaNode::NODE_MAINTENANCE);
             $affected += BasePeer::doUpdate($c1, $c2, $con);
             // update fail and running to fail
             $c1 = new Criteria();
             $c1->add(EtvaNodePeer::LAST_KEEPALIVE, $offset_date, Criteria::LESS_THAN);
             $c1->add(EtvaNodePeer::STATE, EtvaNode::NODE_FAIL_UP);
             // only active
             //update statement
             $c2 = new Criteria();
             $c2->add(EtvaNodePeer::STATE, EtvaNode::NODE_FAIL);
             $affected += BasePeer::doUpdate($c1, $c2, $con);
             $con->commit();
             $message = sprintf('%d Node(s) NOT received update in time offset of %d seconds', $affected, $offset);
             if ($affected > 0) {
                 $context->getEventDispatcher()->notify(new sfEvent(sfConfig::get('config_acronym'), 'event.log', array('message' => $message, 'priority' => EtvaEventLogger::ERR)));
             }
             $this->log('[INFO]' . $message);
         } catch (PropelException $e) {
             $con->rollBack();
             throw $e;
         }
     }
     $logger = new sfFileLogger($context->getEventDispatcher(), array('file' => sfConfig::get("sf_log_dir") . '/cron_status.log'));
     // log the message!
     $logger->log("[INFO] The check virtAgents task ran!", 6);
 }
开发者ID:ketheriel,项目名称:ETVA,代码行数:59,代码来源:nodeChecknodeskeepaliveTask.class.php


示例5: getNotas

 public function getNotas($ciclolectivo_id)
 {
     $notaAlumno = array();
     $notaActividad = array();
     // notas del alumno
     $criteria = new Criteria();
     $criteria->add(BoletinActividadesPeer::FK_ALUMNO_ID, $this->getId());
     $criteria->add(PeriodoPeer::CALCULAR, false);
     $criteria->add(PeriodoPeer::FK_CICLOLECTIVO_ID, $ciclolectivo_id);
     $criteria->addJoin(BoletinActividadesPeer::FK_ESCALANOTA_ID, EscalanotaPeer::ID);
     $criteria->addJoin(BoletinActividadesPeer::FK_PERIODO_ID, PeriodoPeer::ID);
     $criteria->addAsColumn("boletinActividades_periodo_id", BoletinActividadesPeer::FK_PERIODO_ID);
     $criteria->addAsColumn("boletinActividades_actividad_id", BoletinActividadesPeer::FK_ACTIVIDAD_ID);
     $criteria->addAsColumn("escalanota_nombre", EscalanotaPeer::NOMBRE);
     $aBoletinActividades = BasePeer::doSelect($criteria);
     foreach ($aBoletinActividades as $boletinActividades) {
         $notaAlumno[$boletinActividades[0]][$boletinActividades[1]] = $boletinActividades[2];
         $notaActividad[$boletinActividades[1]][$boletinActividades[0]] = $boletinActividades[2];
     }
     $c = new Criteria();
     $c->add(PeriodoPeer::FK_CICLOLECTIVO_ID, $ciclolectivo_id);
     $c->add(PeriodoPeer::CALCULAR, true);
     $periodos = PeriodoPeer::doSelect($c);
     foreach ($notaActividad as $act_indice => &$act) {
         foreach ($periodos as $periodo) {
             //validar que esten ok
             if (trim($periodo->getFormula()) != '') {
                 list($class_formula, $parametros) = explode('|', $periodo->getFormula());
                 $parametros = explode(',', $parametros);
                 //if (array_intersect($parametros,array_keys($act)) == $parametros) {
                 sfContext::getInstance()->getLogger()->debug("estan todo slo ids");
                 $class_formula = "formula_{$class_formula}";
                 require_once sfConfig::get('sf_lib_dir') . DIRECTORY_SEPARATOR . 'formulas' . DIRECTORY_SEPARATOR . $class_formula . ".class.php";
                 $formula = new $class_formula();
                 $notas_parametros = array();
                 foreach ($parametros as $parametro) {
                     if (isset($act[$parametro])) {
                         array_push($notas_parametros, sprintf("%01.2f", str_replace(",", ".", $act[$parametro])));
                     } else {
                         array_push($notas_parametros, '');
                     }
                 }
                 $nota = $formula->calcular($notas_parametros);
                 $notaAlumno[$periodo->getId()][$act_indice] = $nota;
                 $act[$periodo->getId()] = $nota;
                 //}
                 //else {
                 //    sfContext::getInstance()->getLogger()->debug('faltan parametros para la formula');
                 //}
             } else {
                 sfContext::getInstance()->getLogger()->debug('el periodo es calculable pero no tiene una formula cargada');
             }
         }
     }
     return $notaAlumno;
 }
开发者ID:mediasadc,项目名称:alba,代码行数:56,代码来源:Alumno.php


示例6: 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


示例7: testApplyLimitDuplicateColumnName

 public function testApplyLimitDuplicateColumnName()
 {
     Propel::setDb('oracle', new DBOracle());
     $c = new Criteria();
     $c->setDbName('oracle');
     BookPeer::addSelectColumns($c);
     AuthorPeer::addSelectColumns($c);
     $c->setLimit(1);
     $params = array();
     $sql = BasePeer::createSelectSql($c, $params);
     $this->assertEquals('SELECT B.* FROM (SELECT A.*, rownum AS PROPEL_ROWNUM FROM (SELECT book.ID AS book_ID, book.TITLE AS book_TITLE, book.ISBN AS book_ISBN, book.PRICE AS book_PRICE, book.PUBLISHER_ID AS book_PUBLISHER_ID, book.AUTHOR_ID AS book_AUTHOR_ID, author.ID AS author_ID, author.FIRST_NAME AS author_FIRST_NAME, author.LAST_NAME AS author_LAST_NAME, author.EMAIL AS author_EMAIL, author.AGE AS author_AGESELECT book.ID, book.TITLE, book.ISBN, book.PRICE, book.PUBLISHER_ID, book.AUTHOR_ID, author.ID, author.FIRST_NAME, author.LAST_NAME, author.EMAIL, author.AGE FROM book, author) A ) B WHERE  B.PROPEL_ROWNUM <= 1', $sql, 'applyLimit() creates a subselect with aliased column names when a duplicate column name is found');
 }
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:12,代码来源:DBOracleTest.php


示例8: checkForRepeatedNames

 public function checkForRepeatedNames($validator, $value)
 {
     $criteria = new Criteria();
     $criteria->add(QubitTerm::ID, $this->resource->id, Criteria::NOT_EQUAL);
     $criteria->add(QubitTerm::TAXONOMY_ID, $this->resource->taxonomyId);
     $criteria->addJoin(QubitTerm::ID, QubitTermI18n::ID);
     $criteria->add(QubitTermI18n::CULTURE, $this->context->user->getCulture());
     $criteria->add(QubitTermI18n::NAME, $value);
     if (0 < intval(BasePeer::doCount($criteria)->fetchColumn(0))) {
         throw new sfValidatorError($validator, $this->context->i18n->__('Name - A term with this name already exists.'));
     }
 }
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:12,代码来源:indexAction.class.php


示例9: execute

 public function execute($request)
 {
     if (!isset($request->limit)) {
         $request->limit = sfConfig::get('app_hits_per_page');
     }
     $this->resource = $this->getRoute()->resource;
     $criteria = new Criteria();
     $criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
     $criteria->add(QubitRelation::TYPE_ID, QubitTerm::HAS_PHYSICAL_OBJECT_ID);
     $criteria->addJoin(QubitRelation::OBJECT_ID, QubitInformationObject::ID);
     $this->informationObjects = QubitInformationObject::get($criteria);
     $c2 = clone $criteria;
     $this->foundcount = BasePeer::doCount($c2)->fetchColumn(0);
 }
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:14,代码来源:boxListAction.class.php


示例10: entryDeleted

 /**
  * @param int $entryId
  */
 protected function entryDeleted($entryId)
 {
     $c = new Criteria();
     $c->add(CuePointPeer::ENTRY_ID, $entryId);
     CuePointPeer::setUseCriteriaFilter(false);
     $cuePoints = CuePointPeer::doSelect($c);
     $update = new Criteria();
     $update->add(CuePointPeer::STATUS, CuePointStatus::DELETED);
     $con = Propel::getConnection(myDbHelper::DB_HELPER_CONN_MASTER);
     BasePeer::doUpdate($c, $update, $con);
     foreach ($cuePoints as $cuePoint) {
         kEventsManager::raiseEvent(new kObjectDeletedEvent($cuePoint));
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:17,代码来源:kCuePointManager.php


示例11: testApplyLimitDuplicateColumnNameWithColumn

 public function testApplyLimitDuplicateColumnNameWithColumn()
 {
     Propel::setDb('oracle', new DBOracle());
     $c = new Criteria();
     $c->setDbName('oracle');
     BookPeer::addSelectColumns($c);
     AuthorPeer::addSelectColumns($c);
     $c->addAsColumn('BOOK_PRICE', BookPeer::PRICE);
     $c->setLimit(1);
     $params = array();
     $asColumns = $c->getAsColumns();
     $sql = BasePeer::createSelectSql($c, $params);
     $this->assertEquals('SELECT B.* FROM (SELECT A.*, rownum AS PROPEL_ROWNUM FROM (SELECT book.id AS ORA_COL_ALIAS_0, book.title AS ORA_COL_ALIAS_1, book.isbn AS ORA_COL_ALIAS_2, book.price AS ORA_COL_ALIAS_3, book.publisher_id AS ORA_COL_ALIAS_4, book.author_id AS ORA_COL_ALIAS_5, author.id AS ORA_COL_ALIAS_6, author.first_name AS ORA_COL_ALIAS_7, author.last_name AS ORA_COL_ALIAS_8, author.email AS ORA_COL_ALIAS_9, author.age AS ORA_COL_ALIAS_10, book.price AS BOOK_PRICE FROM book, author) A ) B WHERE  B.PROPEL_ROWNUM <= 1', $sql, 'applyLimit() creates a subselect with aliased column names when a duplicate column name is found');
     $this->assertEquals($asColumns, $c->getAsColumns(), 'createSelectSql supplementary add alias column');
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:15,代码来源:DBOracleTest.php


示例12: entryDeleted

 /**
  * @param int $entryId
  */
 protected function entryDeleted($entryId)
 {
     $c = new Criteria();
     $c->add(AnnotationPeer::ENTRY_ID, $entryId);
     $c->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_DELETED, Criteria::NOT_EQUAL);
     AnnotationPeer::setUseCriteriaFilter(false);
     $annotations = AnnotationPeer::doSelect($c);
     foreach ($annotations as $annotation) {
         kEventsManager::raiseEvent(new kObjectDeletedEvent($annotation));
     }
     $update = new Criteria();
     $update->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_DELETED);
     $con = Propel::getConnection(AnnotationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     BasePeer::doUpdate($c, $update, $con);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:18,代码来源:kAnnotationManager.php


示例13: getCriteriaCacheKey

 public static function getCriteriaCacheKey(Criteria $c)
 {
     $cloned_c = clone $c;
     $arr = array();
     $str = BasePeer::createSelectSql($c, $arr);
     $param_map = array();
     $keys = $c->keys();
     foreach ($keys as $k) {
         $val = $c->getCriterion($k);
         if ($val) {
             $param_map[$k] = $val->hashCode();
         }
     }
     $str .= print_r($param_map, true);
     $cache_key = md5($str);
     return $cache_key;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:17,代码来源:myCriteria.class.php


示例14: deleteMetadataObjects

 /**
  * @param int $objectType
  * @param string $objectId
  */
 protected function deleteMetadataObjects($objectType, $objectId)
 {
     $c = new Criteria();
     $c->add(MetadataPeer::OBJECT_TYPE, $objectType);
     $c->add(MetadataPeer::OBJECT_ID, $objectId);
     $c->add(MetadataPeer::STATUS, Metadata::STATUS_DELETED, Criteria::NOT_EQUAL);
     $peer = null;
     MetadataPeer::setUseCriteriaFilter(false);
     $metadatas = MetadataPeer::doSelect($c);
     foreach ($metadatas as $metadata) {
         kEventsManager::raiseEvent(new kObjectDeletedEvent($metadata));
     }
     $update = new Criteria();
     $update->add(MetadataPeer::STATUS, Metadata::STATUS_DELETED);
     $con = Propel::getConnection(MetadataPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     BasePeer::doUpdate($c, $update, $con);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:21,代码来源:kMetadataObjectDeletedHandler.php


示例15: setJobStateIds

 public static function setJobStateIds($jobs, $stateId)
 {
     $c1 = new Criteria();
     $c2 = new Criteria();
     $c1->add(JobPeer::ID, $jobs, Criteria::IN);
     $c2->add(JobPeer::STATUS_ID, $stateId);
     BasePeer::doUpdate($c1, $c2, Propel::getConnection());
     $state = StatusPeer::retrieveByPK($stateId);
     foreach ($jobs as $id) {
         $logEntry = new Log();
         $logEntry->setWhen(time());
         $logEntry->setPropelClass("Job");
         $logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
         $logEntry->setMessage("Changed job state to " . $state->getState());
         $logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_change_status"));
         $logEntry->setPropelId($id);
         $logEntry->save();
     }
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:19,代码来源:JobPeer.php


示例16: getMiSQL

 public static function getMiSQL($criteria)
 {
     if (!isset($criteria)) {
         return null;
     }
     if (!$criteria->getSelectColumns()) {
         $criteria = clone $criteria;
         self::addSelectColumns($criteria);
     }
     $criteria->setDbName(self::DATABASE_NAME);
     $con = Propel::getConnection($criteria->getDbName());
     $params = array();
     $sql = BasePeer::createSelectSql($criteria, $params);
     $stmt = null;
     $stmt = $con->prepare($sql);
     $stmt->setLimit($criteria->getLimit());
     $stmt->setOffset($criteria->getOffset());
     return $stmt;
 }
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:19,代码来源:TablaPeer.php


示例17: lockObjects

 private static function lockObjects(kExclusiveLockKey $lockKey, array $objects, $max_execution_time)
 {
     $exclusive_objects = array();
     // make sure the objects where not taken -
     $con = Propel::getConnection();
     $not_exclusive_count = 0;
     foreach ($objects as $object) {
         $lock_version = $object->getLockVersion();
         $criteria_for_exclusive_update = new Criteria();
         $criteria_for_exclusive_update->add(BatchJobPeer::ID, $object->getId());
         $criteria_for_exclusive_update->add(BatchJobPeer::LOCK_VERSION, $lock_version);
         $update = new Criteria();
         // increment the lock_version - this will make sure it's exclusive
         $update->add(BatchJobPeer::LOCK_VERSION, $lock_version + 1);
         // increment the execution_attempts
         $update->add(BatchJobPeer::EXECUTION_ATTEMPTS, $object->getExecutionAttempts() + 1);
         $update->add(BatchJobPeer::SCHEDULER_ID, $lockKey->getSchedulerId());
         $update->add(BatchJobPeer::WORKER_ID, $lockKey->getWorkerId());
         $update->add(BatchJobPeer::BATCH_INDEX, $lockKey->getBatchIndex());
         $update->add(BatchJobPeer::LAST_SCHEDULER_ID, $lockKey->getSchedulerId());
         $update->add(BatchJobPeer::LAST_WORKER_ID, $lockKey->getWorkerId());
         $processor_expiration = time() + $max_execution_time;
         $update->add(BatchJobPeer::PROCESSOR_EXPIRATION, $processor_expiration);
         $affectedRows = BasePeer::doUpdate($criteria_for_exclusive_update, $update, $con);
         KalturaLog::log("Lock update affected rows [{$affectedRows}] on job id [" . $object->getId() . "] lock version [{$lock_version}]");
         if ($affectedRows == 1) {
             // fix the object to reflect what is in the DB
             $object->setLockVersion($lock_version + 1);
             $object->setExecutionAttempts($object->getExecutionAttempts() + 1);
             $object->setSchedulerId($lockKey->getSchedulerId());
             $object->setWorkerId($lockKey->getWorkerId());
             $object->setBatchIndex($lockKey->getBatchIndex());
             $object->setProcessorExpiration($processor_expiration);
             KalturaLog::log("Job id [" . $object->getId() . "] locked and returned");
             $exclusive_objects[] = $object;
         } else {
             $not_exclusive_count++;
             KalturaLog::log("Object not exclusive: [" . get_class($object) . "] id [" . $object->getId() . "]");
         }
     }
     return $exclusive_objects;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:42,代码来源:kBatchExclusiveLock.class.php


示例18: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $job_type = $this->getPM("job_type");
     $processor_name = $this->getPM("processor_name");
     $processor_timeout = $this->getPM("processor_timeout");
     $over_quota_partners = $this->getPM("over_quota_partners");
     $defered_partners = $this->getPM("defered_partners");
     $con = Propel::getConnection();
     // fetch one pending row of a given job_type
     // where the over_quota_partner requests are dropped
     // and defered_partners request are of less priority
     $query = "SELECT " . BatchJobPeer::ID . " FROM " . BatchJobPeer::TABLE_NAME . " WHERE " . BatchJobPeer::STATUS . "=" . BatchJob::BATCHJOB_STATUS_PENDING . " AND " . BatchJobPeer::JOB_TYPE . "=" . $job_type . " " . (count($over_quota_partners) ? " AND " . BatchJobPeer::PARTNER_ID . " NOT IN ({$over_quota_partners}) " : "") . " ORDER BY " . (count($defered_partners) ? BatchJobPeer::PARTNER_ID . " IN ({$defered_partners}), " : "") . BatchJobPeer::CREATED_AT . " LIMIT 1";
     $statement = $con->prepareStatement($query);
     $resultset = $statement->executeQuery();
     $batch_job = null;
     while ($resultset->next()) {
         $batch_job = BatchJobPeer::retrieveByPK($resultset->getInt('ID'));
     }
     $batch_job = BatchJobPeer::doSelectOne($c);
     if ($batch_job) {
         // force update to work on the currently selected row and ensure it is still in pending status
         $c->add(BatchJobPeer::ID, $batch_job->getId());
         $c->add(BatchJobPeer::STATUS, BatchJob::BATCHJOB_STATUS_PENDING);
         $update = new Criteria();
         $update->add(BatchJobPeer::STATUS, BatchJob::BATCHJOB_STATUS_QUEUED);
         $update->add(BatchJobPeer::PROCESSOR_NAME, $processor_name);
         $update->add(BatchJobPeer::PROCESSOR_EXPIRATION, time() + $processor_timeout);
         $affectedRows = BasePeer::doUpdate($c, $update, $con);
         if ($affectedRows != 1) {
             $batch_job = null;
         }
     }
     if (!$batch_job) {
         //xx$this->addError ( APIErrors::INVALID_ENTRY_ID, $this->getObjectPrefix() , $entry_id );
     } else {
         $wrapper = objectWrapperBase::getWrapperClass($batch_job, objectWrapperBase::DETAIL_LEVEL_REGULAR);
         // TODO - remove this code when cache works properly when saving objects (in their save method)
         $wrapper->removeFromCache("batch_job", $batch_job->getId());
         $this->addMsg("batchjob", $wrapper);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:41,代码来源:queuependingbatchjobAction.class.php


示例19: lockJob

function lockJob($object)
{
    global $jobStatus;
    $con = Propel::getConnection();
    $lock_version = $object->getVersion();
    $criteria_for_exclusive_update = new Criteria();
    $criteria_for_exclusive_update->add(BatchJobLockPeer::ID, $object->getId());
    $criteria_for_exclusive_update->add(BatchJobLockPeer::VERSION, $lock_version);
    $criteria_for_exclusive_update->add(BatchJobLockPeer::STATUS, $jobStatus);
    $update = new Criteria();
    // increment the lock_version - this will make sure it's exclusive
    $update->add(BatchJobLockPeer::VERSION, $lock_version + 1);
    $update->add(BatchJobLockPeer::STATUS, TEMP_JOB_STATUS);
    $affectedRows = BasePeer::doUpdate($criteria_for_exclusive_update, $update, $con);
    if ($affectedRows != 1) {
        return false;
    }
    // update $object with what is in the database
    $object->setVersion($lock_version + 1);
    $object->setStatus(TEMP_JOB_STATUS);
    return true;
}
开发者ID:DBezemer,项目名称:server,代码行数:22,代码来源:moveConvertJobs.php


示例20: setDefaultGroup

 public function setDefaultGroup()
 {
     $con = Propel::getConnection(sfGuardGroupPeer::DATABASE_NAME);
     $criteria = new Criteria();
     $criteria->add(self::NAME, 'Admin');
     $group = self::doSelectOne($criteria);
     $new = false;
     if (!$group) {
         $group = new sfGuardGroup();
         $new = true;
     }
     $group->setName('Admin');
     $group->setDescription('Admin Group');
     if ($new) {
         $group->save();
     }
     $selectCriteria = $group->buildPkeyCriteria();
     // update values are also stored in Criteria object
     $group->setId(self::DEFAULT_GROUP_ID);
     $updateValues = $group->buildCriteria();
     BasePeer::doUpdate($selectCriteria, $updateValues, $con);
     return $group;
 }
开发者ID:ketheriel,项目名称:ETVA,代码行数:23,代码来源:sfGuardGroupPeer.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BaseSellerControl类代码示例发布时间:2022-05-23
下一篇:
PHP BaseObject类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap