本文整理汇总了PHP中DynaformPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP DynaformPeer::retrieveByPK方法的具体用法?PHP DynaformPeer::retrieveByPK怎么用?PHP DynaformPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynaformPeer
的用法示例。
在下文中一共展示了DynaformPeer::retrieveByPK方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Implementation for 'GET' method for Rest API
*
* @param mixed $dynUid Primary key
*
* @return array $result Returns array within multiple records or a single record depending if
* a single selection was requested passing id(s) as param
*/
protected function get($dynUid = null)
{
$result = array();
try {
$noArguments = true;
$argumentList = func_get_args();
foreach ($argumentList as $arg) {
if (!is_null($arg)) {
$noArguments = false;
}
}
if ($noArguments) {
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(DynaformPeer::DYN_UID);
$criteria->addSelectColumn(DynaformPeer::PRO_UID);
$criteria->addSelectColumn(DynaformPeer::DYN_TYPE);
$criteria->addSelectColumn(DynaformPeer::DYN_FILENAME);
$dataset = AppEventPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dataset->next()) {
$result[] = $dataset->getRow();
}
} else {
$record = DynaformPeer::retrieveByPK($dynUid);
if ($record) {
$result = $record->toArray(BasePeer::TYPE_FIELDNAME);
} else {
$paramValues = "";
foreach ($argumentList as $arg) {
$paramValues .= strlen($paramValues) ? ', ' : '';
if (!is_null($arg)) {
$paramValues .= "{$arg}";
} else {
$paramValues .= "NULL";
}
}
throw new RestException(417, "table Dynaform ({$paramValues})");
}
}
} catch (RestException $e) {
throw new RestException($e->getCode(), $e->getMessage());
} catch (Exception $e) {
throw new RestException(412, $e->getMessage());
}
return $result;
}
示例2: remove
/**
* Remove the Prolication document registry
*
* @param array $aData or string $ProUid
* @return string
*
*/
public function remove($ProUid)
{
if (is_array($ProUid)) {
$ProUid = isset($ProUid['DYN_UID']) ? $ProUid['DYN_UID'] : '';
}
try {
$oPro = DynaformPeer::retrieveByPK($ProUid);
if (!is_null($oPro)) {
Content::removeContent('DYN_TITLE', '', $oPro->getDynUid());
Content::removeContent('DYN_DESCRIPTION', '', $oPro->getDynUid());
$iResult = $oPro->delete();
if (file_exists(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml')) {
unlink(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml');
}
if (file_exists(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.xml')) {
unlink(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.xml');
}
if (file_exists(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.html')) {
unlink(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.html');
}
if (file_exists(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.html')) {
unlink(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.html');
}
return $iResult;
} else {
throw new Exception("The row '{$ProUid}' in table Dynaform doesn't exist!");
}
} catch (Exception $oError) {
throw $oError;
}
}
示例3: remove
/**
* Remove the Prolication document registry
*
* @param array $aData or string $ProUid
* @return string
*
*/
public function remove ($ProUid)
{
if (is_array( $ProUid )) {
$ProUid = (isset( $ProUid['DYN_UID'] ) ? $ProUid['DYN_UID'] : '');
}
try {
$oPro = DynaformPeer::retrieveByPK( $ProUid );
if (! is_null( $oPro )) {
$title = $oPro->getDynTitle();
$type = $oPro->getDynType();
$description = $oPro->getDynDescription();
Content::removeContent( 'DYN_TITLE', '', $oPro->getDynUid() );
Content::removeContent( 'DYN_DESCRIPTION', '', $oPro->getDynUid() );
$iResult = $oPro->delete();
//Add Audit Log
G::auditLog("DeleteDynaform", "Dynaform Title: ".$title.", Type: ".$type.", Description: ".$description);
if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml' )) {
unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml' );
}
if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.xml' )) {
unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.xml' );
}
if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.html' )) {
unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.html' );
}
if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.html' )) {
unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.html' );
}
return $iResult;
} else {
throw (new Exception( "The row '$ProUid' in table Dynaform doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
示例4: catch
catch (err)
{
parent.location = parent.location;
}
</script>');
}
try {
if ($_GET['APP_UID'] !== $_SESSION['APPLICATION']) {
throw new Exception(G::LoadTranslation('ID_INVALID_APPLICATION_ID_MSG', array('<a href=\'' . $_SERVER['HTTP_REFERER'] . '\'>{1}</a>', G::LoadTranslation('ID_REOPEN'))));
}
/*
* PMDynaform
* DYN_VERSION is 1: classic Dynaform,
* DYN_VERSION is 2: responsive form, Pmdynaform.
*/
$dynaForm = DynaformPeer::retrieveByPK($_GET["UID"]);
$swpmdynaform = !is_null($dynaForm) && $dynaForm->getDynVersion() == 2;
if ($swpmdynaform) {
$pmdynaform = $_POST["form"];
}
$oForm = new Form($_SESSION["PROCESS"] . "/" . $_GET["UID"], PATH_DYNAFORM);
$oForm->validatePost();
//Includes
G::LoadClass("case");
//Load the variables
$oCase = new Cases();
$oCase->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs");
$Fields = $oCase->loadCase($_SESSION["APPLICATION"]);
if ($swpmdynaform) {
$Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], $pmdynaform);
}
示例5: addProcessSupervisorDynaform
/**
* Assign a dynaform supervisor of a process
*
* @param string $sProcessUID
* @param string $sDynUID
* @param int $sPudPosition
* @access public
*/
public function addProcessSupervisorDynaform($sProcessUID, $sDynUID, $sPudPosition)
{
$oTypeDynaform = \DynaformPeer::retrieveByPK($sDynUID);
if (is_null( $oTypeDynaform )) {
throw new \Exception(\G::LoadTranslation("ID_DOES NOT_DYNAFORM", array($sDynUID)));
}
$aResp = array();
$sPuUIDT = array();
$sDelimiter = \DBAdapter::getStringDelimiter();
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
$oCriteria->addAsColumn('DYN_TITLE', 'C.CON_VALUE');
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(\StepSupervisorPeer::STEP_UID_OBJ, \DynaformPeer::DYN_UID );
$aConditions[] = array(\StepSupervisorPeer::STEP_TYPE_OBJ, $sDelimiter . 'DYNAFORM' . $sDelimiter );
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(\DynaformPeer::DYN_UID, 'C.CON_ID' );
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DYN_TITLE' . $sDelimiter );
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter );
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
$oCriteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $sDynUID);
$oCriteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'DYNAFORM');
$oCriteria->addAscendingOrderByColumn(\StepSupervisorPeer::STEP_POSITION);
$oDataset = \StepSupervisorPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$sPuUIDT = $aRow['STEP_UID'];
$oDataset->next();
}
if (sizeof($sPuUIDT) == 0) {
$oStepSupervisor = new \StepSupervisor();
$oStepSupervisor->create(array('PRO_UID' => $sProcessUID,
'STEP_TYPE_OBJ' => "DYNAFORM",
'STEP_UID_OBJ' => $sDynUID,
'STEP_POSITION' => $oStepSupervisor->getNextPosition($sProcessUID, "DYNAFORM")));
$sDelimiter = \DBAdapter::getStringDelimiter();
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
$oCriteria->addSelectColumn(\StepSupervisorPeer::PRO_UID);
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID_OBJ);
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_POSITION);
$oCriteria->addAsColumn('DYN_TITLE', 'C.CON_VALUE');
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(\StepSupervisorPeer::STEP_UID_OBJ, \DynaformPeer::DYN_UID );
$aConditions[] = array(\StepSupervisorPeer::STEP_TYPE_OBJ, $sDelimiter . 'DYNAFORM' . $sDelimiter );
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(\DynaformPeer::DYN_UID, 'C.CON_ID' );
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DYN_TITLE' . $sDelimiter );
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter );
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
$oCriteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $sDynUID);
$oCriteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'DYNAFORM');
$oCriteria->addAscendingOrderByColumn(\StepSupervisorPeer::STEP_POSITION);
$oDataset = \StepSupervisorPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aResp = array('pud_uid' => $aRow['STEP_UID'],
'pud_position' => $aRow['STEP_POSITION'],
'dyn_uid' => $aRow['STEP_UID_OBJ']);
$oDataset->next();
$aRespPosition = $this->updateProcessSupervisorDynaform($sProcessUID ,$aRow['STEP_UID'], $sPudPosition);
$aResp = array_merge(array('dyn_title' => $aRow['DYN_TITLE']), $aRespPosition);
}
return $aResp;
} else {
throw new \Exception(\G::LoadTranslation("ID_RELATION_EXIST"));
}
}
示例6: getSteps
public function getSteps ($appUid, $index, $tasUid, $proUid)
{
//require_once 'classes/model/Step.php';
//require_once 'classes/model/Content.php';
//require_once 'classes/model/AppDocument.php';
//require_once 'classes/model/InputDocumentPeer.php';
//require_once 'classes/model/OutputDocument.php';
//require_once 'classes/model/Dynaform.php';
//G::LoadClass( 'pmScript' );
G::LoadClass( 'case' );
$steps = Array ();
$case = new Cases();
$step = new Step();
$appDocument = new AppDocument();
$caseSteps = $step->getAllCaseSteps( $proUid, $tasUid, $appUid );
//getting externals steps
$oPluginRegistry = &PMPluginRegistry::getSingleton();
$eSteps = $oPluginRegistry->getSteps();
$externalSteps = array ();
foreach ($eSteps as $externalStep) {
$externalSteps[$externalStep->sStepId] = $externalStep;
}
//getting the case record
if ($appUid) {
$caseData = $case->loadCase( $appUid );
$pmScript = new PMScript();
$pmScript->setFields( $caseData['APP_DATA'] );
}
$externalStepCount = 0;
foreach ($caseSteps as $caseStep) {
// if it has a condition
if (trim( $caseStep->getStepCondition() ) != '') {
$pmScript->setScript( $caseStep->getStepCondition() );
if (! $pmScript->evaluate()) {
//evaluated false, jump & continue with the others steps
continue;
}
}
$stepUid = $caseStep->getStepUidObj();
$stepType = $caseStep->getStepTypeObj();
$stepPosition = $caseStep->getStepPosition();
$stepItem = array ();
$stepItem['id'] = $stepUid;
$stepItem['type'] = $stepType;
switch ($stepType) {
case 'DYNAFORM':
$oDocument = DynaformPeer::retrieveByPK( $stepUid );
$stepItem['title'] = $oDocument->getDynTitle();
$stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=EDIT";
$stepItem['version'] = $oDocument->getDynVersion();
break;
case 'OUTPUT_DOCUMENT':
$oDocument = OutputDocumentPeer::retrieveByPK( $caseStep->getStepUidObj() );
$outputDoc = $appDocument->getObject( $appUid, $index, $caseStep->getStepUidObj(), 'OUTPUT' );
$stepItem['title'] = $oDocument->getOutDocTitle();
if ($outputDoc['APP_DOC_UID']) {
$stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=VIEW&DOC={$outputDoc['APP_DOC_UID']}";
} else {
$stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=GENERATE";
}
break;
case 'INPUT_DOCUMENT':
$oDocument = InputDocumentPeer::retrieveByPK( $stepUid );
$stepItem['title'] = $oDocument->getInpDocTitle();
$stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=ATTACH";
break;
case 'EXTERNAL':
$stepTitle = 'unknown ' . $caseStep->getStepUidObj();
$oPluginRegistry = PMPluginRegistry::getSingleton();
$externalStep = $externalSteps[$caseStep->getStepUidObj()];
$stepItem['id'] = $externalStep->sStepId;
$stepItem['title'] = $externalStep->sStepTitle;
$stepItem['url'] = "cases/cases_Step?UID={$externalStep->sStepId}&TYPE=EXTERNAL&POSITION=$stepPosition&ACTION=EDIT";
break;
}
$steps[] = $stepItem;
}
//last, assign task
$stepItem = array ();
$stepItem['id'] = '-1';
$stepItem['type'] = '';
$stepItem['title'] = G::LoadTranslation( 'ID_ASSIGN_TASK' );
$stepItem['url'] = "cases/cases_Step?TYPE=ASSIGN_TASK&UID=-1&POSITION=10000&ACTION=ASSIGN";
//.........这里部分代码省略.........
示例7: setCaseVariables
/**
* Put Set Case Variables
*
* @access public
* @param string $app_uid, Uid for case
* @param array $app_data, Data for case variables
* @param string $dyn_uid, Uid for dynaform
* @param string $usr_uid, Uid for user
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*/
public function setCaseVariables($app_uid, $app_data, $dyn_uid = null, $usr_uid)
{
Validator::isString($app_uid, '$app_uid');
Validator::appUid($app_uid, '$app_uid');
Validator::isArray($app_data, '$app_data');
Validator::isString($usr_uid, '$usr_uid');
Validator::usrUid($usr_uid, '$usr_uid');
$arrayResult = $this->getStatusInfo($app_uid);
if ($arrayResult["APP_STATUS"] == "CANCELLED") {
throw new \Exception(\G::LoadTranslation("ID_CASE_CANCELLED", array($app_uid)));
}
if ($arrayResult["APP_STATUS"] == "COMPLETED") {
throw new \Exception(\G::LoadTranslation("ID_CASE_IS_COMPLETED", array($app_uid)));
}
$appCacheView = new \AppCacheView();
$isProcessSupervisor = $appCacheView->getProUidSupervisor($usr_uid);
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
$criteria->add(\AppDelegationPeer::APP_UID, $app_uid, \Criteria::EQUAL);
$criteria->add(\AppDelegationPeer::USR_UID, $usr_uid, \Criteria::EQUAL);
$criteria->add(
$criteria->getNewCriterion(\AppDelegationPeer::USR_UID, $usr_uid, \Criteria::EQUAL)->addOr(
$criteria->getNewCriterion(\AppDelegationPeer::PRO_UID, $isProcessSupervisor, \Criteria::IN))
);
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
if (!$rsCriteria->next()) {
throw (new \Exception(\G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED", array($usr_uid))));
}
$_SESSION['APPLICATION'] = $app_uid;
$_SESSION['USER_LOGGED'] = $usr_uid;
$case = new \Cases();
$fields = $case->loadCase($app_uid);
$_POST['form'] = $app_data;
if (!is_null($dyn_uid) && $dyn_uid != '') {
$oDynaform = \DynaformPeer::retrieveByPK($dyn_uid);
if ($oDynaform->getDynVersion() < 2) {
$oForm = new \Form ( $fields['PRO_UID'] . "/" . $dyn_uid, PATH_DYNAFORM );
$oForm->validatePost();
}
}
$data['APP_DATA'] = array_merge($fields['APP_DATA'], $_POST['form']);
$case->updateCase($app_uid, $data);
}
示例8: setCaseVariables
/**
* Put Set Case Variables
*
* @access public
* @param string $app_uid, Uid for case
* @param array $app_data, Data for case variables
* @param string $dyn_uid, Uid for dynaform
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*/
public function setCaseVariables($app_uid, $app_data, $dyn_uid = null)
{
Validator::isString($app_uid, '$app_uid');
Validator::appUid($app_uid, '$app_uid');
Validator::isArray($app_data, '$app_data');
$case = new \Cases();
$fields = $case->loadCase($app_uid);
$_POST['form'] = $app_data;
if (!is_null($dyn_uid) && $dyn_uid != '') {
$oDynaform = \DynaformPeer::retrieveByPK($dyn_uid);
if ($oDynaform->getDynVersion() < 2) {
$oForm = new \Form ( $fields['PRO_UID'] . "/" . $dyn_uid, PATH_DYNAFORM );
$oForm->validatePost();
}
}
$data['APP_DATA'] = array_merge($fields['APP_DATA'], $_POST['form']);
$case->updateCase($app_uid, $data);
}
示例9: Cases
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
$oPMScript = new PMScript();
$oPMScript->setFields($Fields['APP_DATA']);
foreach ($rs as $key => $aRow) {
$bAccessStep = false;
if (trim($aRow->getStepCondition()) != '') {
$oPMScript->setScript($aRow->getStepCondition());
$bAccessStep = $oPMScript->evaluate();
} else {
$bAccessStep = true;
}
if ($bAccessStep) {
switch ($aRow->getStepTypeObj()) {
case 'DYNAFORM':
$oDocument = DynaformPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getDynTitle();
break;
case 'OUTPUT_DOCUMENT':
$oDocument = OutputDocumentPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getOutDocTitle();
break;
case 'INPUT_DOCUMENT':
$oDocument = InputDocumentPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getInpDocTitle();
$sType = $oDocument->getInpDocFormNeeded();
break;
case 'EXTERNAL':
$stepTitle = 'unknown ' . $aRow->getStepUidObj();
$oPluginRegistry =& PMPluginRegistry::getSingleton();
foreach ($externalSteps as $key => $val) {