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


PHP AppDelegationPeer::retrieveByPk方法代码示例

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


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

示例1: calculateDuration

 public function calculateDuration($cron = 0)
 {
     try {
         if ($cron == 1) {
             $arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
             $arrayCron["processcTimeStart"] = time();
             @file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
         }
         //patch  rows with initdate = null and finish_date
         $c = new Criteria();
         $c->clearSelectColumns();
         $c->addSelectColumn(AppDelegationPeer::APP_UID);
         $c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
         $c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
         $c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
         $c->add(AppDelegationPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
         $c->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNOTNULL);
         //$c->add(AppDelegationPeer::DEL_INDEX, 1);
         $rs = AppDelegationPeer::doSelectRS($c);
         $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $rs->next();
         $row = $rs->getRow();
         while (is_array($row)) {
             $oAppDel = AppDelegationPeer::retrieveByPk($row['APP_UID'], $row['DEL_INDEX']);
             if (isset($row['DEL_FINISH_DATE'])) {
                 $oAppDel->setDelInitDate($row['DEL_FINISH_DATE']);
             } else {
                 $oAppDel->setDelInitDate($row['DEL_INIT_DATE']);
             }
             $oAppDel->save();
             $rs->next();
             $row = $rs->getRow();
         }
         //walk in all rows with DEL_STARTED = 0 or DEL_FINISHED = 0
         $c = new Criteria('workflow');
         $c->clearSelectColumns();
         $c->addSelectColumn(AppDelegationPeer::APP_UID);
         $c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
         $c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
         $c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
         $c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
         $c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
         $c->addSelectColumn(AppDelegationPeer::DEL_DURATION);
         $c->addSelectColumn(AppDelegationPeer::DEL_QUEUE_DURATION);
         $c->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
         $c->addSelectColumn(AppDelegationPeer::DEL_STARTED);
         $c->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
         $c->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
         $c->addSelectColumn(TaskPeer::TAS_DURATION);
         $c->addSelectColumn(TaskPeer::TAS_TIMEUNIT);
         $c->addSelectColumn(TaskPeer::TAS_TYPE_DAY);
         $c->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
         //$c->add(AppDelegationPeer::DEL_INIT_DATE, NULL, Criteria::ISNULL);
         //$c->add(AppDelegationPeer::APP_UID, '7694483844a37bfeb0931b1063501289');
         //$c->add(AppDelegationPeer::DEL_STARTED, 0);
         $cton1 = $c->getNewCriterion(AppDelegationPeer::DEL_STARTED, 0);
         $cton2 = $c->getNewCriterion(AppDelegationPeer::DEL_FINISHED, 0);
         $cton1->addOR($cton2);
         $c->add($cton1);
         $rs = AppDelegationPeer::doSelectRS($c);
         $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $rs->next();
         $row = $rs->getRow();
         $i = 0;
         //print "<table colspacing='2' border='1'>";
         //print "<tr><td>iDelegateDate </td><td>iInitDate </td><td>iDueDate </td><td>iFinishDate </td><td>isStarted </td><td>isFinished </td><td>isDelayed </td><td>queueDuration </td><td>delDuration </td><td>delayDuration</td></tr>";
         $now = strtotime('now');
         while (is_array($row)) {
             $fTaskDuration = $row['TAS_DURATION'];
             $iDelegateDate = strtotime($row['DEL_DELEGATE_DATE']);
             $iInitDate = strtotime($row['DEL_INIT_DATE']);
             $iDueDate = strtotime($row['DEL_TASK_DUE_DATE']);
             $iFinishDate = strtotime($row['DEL_FINISH_DATE']);
             $isStarted = intval($row['DEL_STARTED']);
             $isFinished = intval($row['DEL_FINISHED']);
             $isDelayed = intval($row['DEL_DELAYED']);
             $queueDuration = $this->getDiffDate($iInitDate, $iDelegateDate);
             $delDuration = 0;
             $delayDuration = 0;
             $overduePercentage = 0.0;
             //get the object,
             $oAppDel = AppDelegationPeer::retrieveByPk($row['APP_UID'], $row['DEL_INDEX']);
             //if the task is not started
             if ($isStarted == 0) {
                 if ($row['DEL_INIT_DATE'] != null && $row['DEL_INIT_DATE'] != '') {
                     $oAppDel->setDelStarted(1);
                     $queueDuration = $this->getDiffDate($iInitDate, $iDelegateDate);
                     $oAppDel->setDelQueueDuration($queueDuration);
                 } else {
                     //the task was not started
                     $queueDuration = $this->getDiffDate($now, $iDelegateDate);
                     $oAppDel->setDelQueueDuration($queueDuration);
                     //we are putting negative number if the task is not delayed, and positive number for the time the task is delayed
                     $delayDuration = $this->getDiffDate($now, $iDueDate);
                     $oAppDel->setDelDelayDuration($delayDuration);
                     if ($fTaskDuration != 0) {
                         $overduePercentage = $delayDuration / $fTaskDuration;
                         $oAppDel->setAppOverduePercentage($overduePercentage);
                         if ($iDueDate < $now) {
                             $oAppDel->setDelDelayed(1);
//.........这里部分代码省略.........
开发者ID:norahmollo,项目名称:processmaker,代码行数:101,代码来源:AppDelegation.php

示例2: setCatchUser

    public function setCatchUser($sAppUid, $iDelIndex, $usrId)

    {

        try {

            $oAppDel = AppDelegationPeer::retrieveByPk($sAppUid, $iDelIndex);

            $oAppDel->setDelInitDate("now");

            $oAppDel->setUsrUid($usrId);

            $oAppDel->save();



            //update searchindex

            if ($this->appSolr != null) {

                $this->appSolr->updateApplicationSearchIndex($sAppUid);

            }



            //Delete record of the table APP_ASSIGN_SELF_SERVICE_VALUE

            $appAssignSelfServiceValue = new AppAssignSelfServiceValue();



            $appAssignSelfServiceValue->remove($sAppUid, $iDelIndex);

            /*----------------------------------********---------------------------------*/

        } catch (exception $e) {

            throw ($e);

        }

    }
开发者ID:nhenderson,项目名称:processmaker,代码行数:43,代码来源:class.case.php

示例3: Users

 $oUser = new Users();
 $aUser = $oUser->load($_SESSION['USER_LOGGED']);
 if (trim($aUser['USR_EMAIL']) == '') {
     $aUser['USR_EMAIL'] = 'info@' . $_SERVER['HTTP_HOST'];
 }
 $sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '" <' . $aUser['USR_EMAIL'] . '>';
 try {
     $oCase->sendNotifications($_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName);
 } catch (Exception $e) {
     G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR') . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%');
 }
 // Send notifications - End
 // Events - Start
 $oEvent = new Event();
 $oEvent->closeAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
 $oCurrentAppDel = AppDelegationPeer::retrieveByPk($_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1);
 $multipleDelegation = false;
 // check if there are multiple derivations
 if (count($_POST['form']['TASKS']) > 1) {
     $multipleDelegation = true;
 }
 // If the case has been delegated
 if (isset($oCurrentAppDel)) {
     // if there is just a single derivation the TASK_UID can be set by the delegation data
     if (!$multipleDelegation) {
         $aCurrentAppDel = $oCurrentAppDel->toArray(BasePeer::TYPE_FIELDNAME);
         $oEvent->createAppEvents($aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID']);
     } else {
         // else we need to check every task and create the events if it have any
         foreach ($_POST['form']['TASKS'] as $taskDelegated) {
             $aCurrentAppDel = $oCurrentAppDel->toArray(BasePeer::TYPE_FIELDNAME);
开发者ID:ralpheav,项目名称:processmaker,代码行数:31,代码来源:cases_Derivate.php

示例4: setCatchUser

 public function setCatchUser($sAppUid, $iDelIndex, $usrId)
 {
     try {
         $oAppDel = AppDelegationPeer::retrieveByPk($sAppUid, $iDelIndex);
         $oAppDel->setDelInitDate("now");
         $oAppDel->setUsrUid($usrId);
         $oAppDel->save();
         //update searchindex
         if ($this->appSolr != null) {
             $this->appSolr->updateApplicationSearchIndex($sAppUid);
         }
     } catch (exception $e) {
         throw $e;
     }
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:15,代码来源:class.case.php

示例5: patchDataWithValuesForCalculateDuration

	private function patchDataWithValuesForCalculateDuration() 

	{

		//patch  rows with initdate = null and finish_date

		$c = new Criteria();

		$c->clearSelectColumns();

		$c->addSelectColumn( AppDelegationPeer::APP_UID );

		$c->addSelectColumn( AppDelegationPeer::DEL_INDEX );

		$c->addSelectColumn( AppDelegationPeer::DEL_DELEGATE_DATE );

		$c->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE );

		$c->add( AppDelegationPeer::DEL_INIT_DATE, null, Criteria::ISNULL );

		$c->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNOTNULL );

		//$c->add(AppDelegationPeer::DEL_INDEX, 1);





		$rs = AppDelegationPeer::doSelectRS( $c );

		$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );

		$rs->next();

		$row = $rs->getRow();



		while (is_array( $row )) {

			$oAppDel = AppDelegationPeer::retrieveByPk( $row['APP_UID'], $row['DEL_INDEX'] );

			if (isset( $row['DEL_FINISH_DATE'] )) {

				$oAppDel->setDelInitDate( $row['DEL_FINISH_DATE'] );

			} else {

				$oAppDel->setDelInitDate( $row['DEL_INIT_DATE'] );

			}

			$oAppDel->save();



			$rs->next();

			$row = $rs->getRow();

		}

	}
开发者ID:rrsc,项目名称:processmaker,代码行数:63,代码来源:AppDelegation.php


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