本文整理汇总了PHP中ApplicationPeer::retrieveByPk方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationPeer::retrieveByPk方法的具体用法?PHP ApplicationPeer::retrieveByPk怎么用?PHP ApplicationPeer::retrieveByPk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationPeer
的用法示例。
在下文中一共展示了ApplicationPeer::retrieveByPk方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPreviousStep
public function getPreviousStep($sProUid = '', $sAppUid = '', $iDelIndex = 0, $iPosition = 0)
{
//Note: Depreciated, delete in the future
G::LoadClass('pmScript');
$oPMScript = new PMScript();
$oApplication = new Application();
//$aFields = $oApplication->load($sAppUid);
$oApplication = ApplicationPeer::retrieveByPk($sAppUid);
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
if (!is_array($aFields['APP_DATA'])) {
$aFields['APP_DATA'] = G::array_merges(G::getSystemConstants(), unserialize($aFields['APP_DATA']));
}
$oPMScript->setFields($aFields['APP_DATA']);
try {
//get the current Delegation, and TaskUID
$c = new Criteria();
$c->add(AppDelegationPeer::PRO_UID, $sProUid);
$c->add(AppDelegationPeer::APP_UID, $sAppUid);
$c->add(AppDelegationPeer::DEL_INDEX, $iDelIndex);
$aRow = AppDelegationPeer::doSelect($c);
$sTaskUid = $aRow[0]->getTasUid();
$iFirstStep = 1;
if ($iPosition == 10000) {
//get max step for this task
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn('MAX(' . StepPeer::STEP_POSITION . ')');
$c->add(StepPeer::PRO_UID, $sProUid);
$c->add(StepPeer::TAS_UID, $sTaskUid);
$rs = StepPeer::doSelectRS($c);
$rs->next();
$row = $rs->getRow();
$iPosition = intval($row[0]);
} else {
$iPosition -= 1;
}
$aPreviousStep = null;
if ($iPosition >= 1) {
while ($iPosition >= $iFirstStep) {
$bAccessStep = false;
//step
$oStep = new Step;
$oStep = $oStep->loadByProcessTaskPosition($sProUid, $sTaskUid, $iPosition);
if ($oStep) {
if (trim($oStep->getStepCondition()) !== '') {
$oPMScript->setScript($oStep->getStepCondition());
//.........这里部分代码省略.........
示例2: executeEvents
public function executeEvents($sNow, $debug = false, &$log = array(), $cron = 0)
{
require_once 'classes/model/Configuration.php';
require_once 'classes/model/Triggers.php';
G::LoadClass('case');
$debug = 1;
$oCase = new Cases();
try {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(AppEventPeer::APP_UID);
$oCriteria->addSelectColumn(AppEventPeer::DEL_INDEX);
$oCriteria->addSelectColumn(AppEventPeer::EVN_UID);
$oCriteria->addSelectColumn(AppEventPeer::APP_EVN_ACTION_DATE);
$oCriteria->addSelectColumn(AppEventPeer::APP_EVN_ATTEMPTS);
$oCriteria->addSelectColumn(AppEventPeer::APP_EVN_LAST_EXECUTION_DATE);
$oCriteria->addSelectColumn(AppEventPeer::APP_EVN_STATUS);
$oCriteria->addSelectColumn(EventPeer::PRO_UID);
$oCriteria->addSelectColumn(EventPeer::EVN_ACTION);
$oCriteria->addSelectColumn(EventPeer::TRI_UID);
$oCriteria->addSelectColumn(EventPeer::EVN_ACTION_PARAMETERS);
$oCriteria->addSelectColumn(EventPeer::EVN_RELATED_TO);
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::USR_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
$oCriteria->addJoin(AppEventPeer::EVN_UID, EventPeer::EVN_UID, Criteria::JOIN);
$aConditions = array();
array_push($aConditions, array(AppEventPeer::APP_UID, AppDelegationPeer::APP_UID));
array_push($aConditions, array(AppEventPeer::DEL_INDEX, AppDelegationPeer::DEL_INDEX));
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->addJoin(ApplicationPeer::APP_UID, AppEventPeer::APP_UID);
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
//by me
$oCriteria->add(AppEventPeer::APP_EVN_STATUS, 'OPEN');
$oCriteria->add(AppEventPeer::APP_EVN_ACTION_DATE, $sNow, Criteria::LESS_EQUAL);
$oDataset = AppEventPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$c = 0;
while ($oDataset->next()) {
if ($cron == 1) {
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
$arrayCron["processcTimeStart"] = time();
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
}
$c++;
$aRow = $oDataset->getRow();
$oTrigger = new Triggers();
$aFields = $oCase->loadCase($aRow['APP_UID']);
$oAppEvent = AppEventPeer::retrieveByPK($aRow['APP_UID'], $aRow['DEL_INDEX'], $aRow['EVN_UID']);
//g::pr($aRow); //die;
if ($debug) {
require_once 'classes/model/Application.php';
$oApp = ApplicationPeer::retrieveByPk($aRow['APP_UID']);
$oEv = EventPeer::retrieveByPk($aRow['EVN_UID']);
$log[] = 'Event ' . $oEv->getEvnDescription() . ' with ID ' . $aRow['EVN_UID'];
println("\nOK+ event \"" . $oEv->getEvnDescription() . "\" with ID {} was found");
println(" - PROCESS................" . $aRow['PRO_UID']);
println(" - APPLICATION............" . $aRow['APP_UID'] . " CASE #" . $oApp->getAppNumber());
println(" - ACTION DATE............" . $aRow['APP_EVN_ACTION_DATE']);
println(" - ATTEMPTS..............." . $aRow['APP_EVN_ATTEMPTS']);
println(" - INTERVAL WITH TASKS...." . $aRow['EVN_RELATED_TO']);
}
if ($aRow['TRI_UID'] == '') {
//a rare case when the tri_uid is not set.
$log[] = " (!) Any trigger was set................................SKIPPED and will be CLOSED";
if ($debug) {
println(" (!) Any trigger was set................................SKIPPED and will be CLOSED");
}
$oAppEvent->setAppEvnStatus('CLOSE');
$oAppEvent->save();
continue;
}
$oTrigger = TriggersPeer::retrieveByPk($aRow['TRI_UID']);
if (!is_object($oTrigger)) {
//the trigger record doesn't exist..
$log[] = ' (!) The trigger ' . $aRow['TRI_UID'] . ' ' . $oTrigger->getTriTitle() . " doesn't exist.......SKIPPED and will be CLOSED";
if ($debug) {
println(" (!) The trigger {$aRow['TRI_UID']} {$oTrigger->getTriTitle()} doesn't exist.......SKIPPED and will be CLOSED");
}
$oAppEvent->setAppEvnStatus('CLOSE');
$oAppEvent->save();
continue;
}
global $oPMScript;
$oPMScript = new PMScript();
$task = new Task();
$taskFields = $task->Load($aRow['TAS_UID']);
$aFields['APP_DATA']['APP_NUMBER'] = $aFields['APP_NUMBER'];
$aFields['APP_DATA']['TAS_TITLE'] = $taskFields['TAS_TITLE'];
$aFields['APP_DATA']['DEL_TASK_DUE_DATE'] = $aRow['DEL_TASK_DUE_DATE'];
$oPMScript->setFields($aFields['APP_DATA']);
$oPMScript->setScript($oTrigger->getTriWebbot());
$oPMScript->execute();
$oAppEvent->setAppEvnLastExecutionDate(date('Y-m-d H:i:s'));
if (sizeof($_SESSION['TRIGGER_DEBUG']['ERRORS']) == 0) {
$log[] = ' - The trigger ' . $oTrigger->getTriTitle() . ' was executed successfully!';
if ($debug) {
println(" - The trigger '{$oTrigger->getTriTitle()}' was executed successfully!");
//g::pr($aFields);
}
//.........这里部分代码省略.........
示例3: Load
/**
* Load the Application row specified in [app_id] column value.
*
* @param string $AppUid the uid of the application
* @return array $Fields the fields
*/
public function Load($AppUid)
{
$con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
try {
$oApplication = ApplicationPeer::retrieveByPk($AppUid);
if (is_object($oApplication) && get_class($oApplication) == 'Application') {
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
//this is the new function to optimize content queries
$aContentFields = $oApplication->getContentFields();
$aFields['APP_TITLE'] = $aContentFields['APP_TITLE'];
$aFields['APP_DESCRIPTION'] = $aContentFields['APP_DESCRIPTION'];
$this->app_title = $aFields['APP_TITLE'];
$this->app_description = $aFields['APP_DESCRIPTION'];
//$aFields['APP_PROC_CODE'] = $oApplication->getAppProcCode();
//$this->setAppProcCode($oApplication->getAppProcCode());
return $aFields;
} else {
throw new Exception("The Application row '{$AppUid}' doesn't exist!");
}
} catch (Exception $oError) {
throw $oError;
}
}
示例4: executeDelete
/**
* CODE: application_delete
*/
public function executeDelete(sfWebRequest $request)
{
if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
if ($request->isMethod('delete')) {
$request->checkCSRFProtection();
$this->forward404Unless($application = ApplicationPeer::retrieveByPk($request->getParameter('id')), sprintf('Object application does not exist (%s).', $request->getParameter('id')));
$application->delete();
$this->getUser()->setFlash('success', 'You have successfully removed an application!');
$this->redirect('@member_view?id=' . $application->getMemberId());
}
$this->redirect('@homepage');
}