本文整理汇总了PHP中ConfigurationPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigurationPeer::retrieveByPK方法的具体用法?PHP ConfigurationPeer::retrieveByPK怎么用?PHP ConfigurationPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigurationPeer
的用法示例。
在下文中一共展示了ConfigurationPeer::retrieveByPK方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Implementation for 'GET' method for Rest API
*
* @param mixed $cfgUid, $objUid, $proUid, $usrUid, $appUid 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($cfgUid = null, $objUid = null, $proUid = null, $usrUid = null, $appUid = 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(ConfigurationPeer::CFG_UID);
$criteria->addSelectColumn(ConfigurationPeer::OBJ_UID);
$criteria->addSelectColumn(ConfigurationPeer::CFG_VALUE);
$criteria->addSelectColumn(ConfigurationPeer::PRO_UID);
$criteria->addSelectColumn(ConfigurationPeer::USR_UID);
$criteria->addSelectColumn(ConfigurationPeer::APP_UID);
$dataset = AppEventPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dataset->next()) {
$result[] = $dataset->getRow();
}
} else {
$record = ConfigurationPeer::retrieveByPK($cfgUid, $objUid, $proUid, $usrUid, $appUid);
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 Configuration ({$paramValues})");
}
}
} catch (RestException $e) {
throw new RestException($e->getCode(), $e->getMessage());
} catch (Exception $e) {
throw new RestException(412, $e->getMessage());
}
return $result;
}
示例2: getConfiguration
/**
* getConfiguration
*
* @param string $cfg
* @param object $obj
* @param string $pro
* @param string $usr
* @param string $app
* @return void
*/
public function getConfiguration($cfg, $obj, $pro = '', $usr = '', $app = '')
{
try {
$oCfg = ConfigurationPeer::retrieveByPK($cfg, $obj, $pro, $usr, $app);
if (!is_null($oCfg)) {
$row = $oCfg->toArray(BasePeer::TYPE_FIELDNAME);
$result = unserialize($row['CFG_VALUE']);
if (is_array($result) && sizeof($result) == 1) {
$arrayKeys = Array_keys($result);
return $result[$arrayKeys[0]];
} else {
return $result;
}
} else {
return null;
}
} catch (Exception $oError) {
return null;
}
}
示例3: exists
/**
* To check if the configuration row exists, by using Configuration Uid data
*/
public function exists($CfgUid, $ObjUid = '', $ProUid = '', $UsrUid = '', $AppUid = '')
{
$oRow = ConfigurationPeer::retrieveByPK($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid);
return get_class($oRow) == 'Configuration' && !is_null($oRow);
}
示例4: deleteProcess
public function deleteProcess($sProcessUID, $flagRemoveCases = true)
{
try {
//G::LoadClass('case');
//G::LoadClass('reportTables');
//Instance all classes necesaries
$oProcess = new \Process();
$oDynaform = new \Dynaform();
$oInputDocument = new \InputDocument();
$oOutputDocument = new \OutputDocument();
$oTrigger = new \Triggers();
$oRoute = new \Route();
$oGateway = new \Gateway();
$oEvent = new \Event();
$oSwimlaneElement = new \SwimlanesElements();
$oConfiguration = new \Configuration();
$oDbSource = new \DbSource();
$oReportTable = new \ReportTables();
$oCaseTracker = new \CaseTracker();
$oCaseTrackerObject = new \CaseTrackerObject();
//Update PROCESS_FILES_CHECKED
$configuration = \ConfigurationPeer::retrieveByPK("PROCESS_FILES_CHECKED", "", "", "", "");
if (!is_null($configuration)) {
$arrayProjectUid = unserialize($configuration->getCfgValue());
unset($arrayProjectUid[$sProcessUID]);
$conf = new \Configuration();
$result = $conf->update(array("CFG_UID" => "PROCESS_FILES_CHECKED", "OBJ_UID" => "", "CFG_VALUE" => serialize($arrayProjectUid), "PRO_UID" => "", "USR_UID" => "", "APP_UID" => ""));
}
//Delete the applications of process
if ($flagRemoveCases) {
$case = new \Cases();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ApplicationPeer::APP_UID);
$criteria->add(\ApplicationPeer::PRO_UID, $sProcessUID, \Criteria::EQUAL);
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $case->removeCase($row["APP_UID"]);
}
}
//Delete the tasks of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\TaskPeer::PRO_UID, $sProcessUID);
$oDataset = \TaskPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
//$this->deleteTask($aRow['TAS_UID']);
$oTasks = new \Tasks();
$oTasks->deleteTask($aRow['TAS_UID']);
$oDataset->next();
}
//Delete the dynaforms of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\DynaformPeer::PRO_UID, $sProcessUID);
$oDataset = \DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oDynaform->remove($aRow['DYN_UID']);
$oDataset->next();
}
//Delete the input documents of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\InputDocumentPeer::PRO_UID, $sProcessUID);
$oDataset = \InputDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oInputDocument->remove($aRow['INP_DOC_UID']);
$oDataset->next();
}
//Delete the output documents of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\OutputDocumentPeer::PRO_UID, $sProcessUID);
$oDataset = \OutputDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oOutputDocument->remove($aRow['OUT_DOC_UID']);
$oDataset->next();
}
//Delete the triggers of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\TriggersPeer::PRO_UID, $sProcessUID);
$oDataset = \TriggersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oTrigger->remove($aRow['TRI_UID']);
$oDataset->next();
}
//Delete the routes of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\RoutePeer::PRO_UID, $sProcessUID);
$oDataset = \RoutePeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
//.........这里部分代码省略.........
示例5: processFilesUpgrade
/**
* Process-Files upgrade
*
* @param string $projectUid Unique id of Project
*
* return void
*/
public function processFilesUpgrade($projectUid = "")
{
try {
//Set variables
$conf = new \Configuration();
//Create/Get PROCESS_FILES_CHECKED
$arrayProjectUid = array();
$configuration = \ConfigurationPeer::retrieveByPK("PROCESS_FILES_CHECKED", "", "", "", "");
if (is_null($configuration)) {
$result = $conf->create(array(
"CFG_UID" => "PROCESS_FILES_CHECKED",
"OBJ_UID" => "",
"CFG_VALUE" => serialize($arrayProjectUid),
"PRO_UID" => "",
"USR_UID" => "",
"APP_UID" => ""
));
} else {
$arrayProjectUid = unserialize($configuration->getCfgValue());
}
//Set variables
$arrayPath = array("templates" => PATH_DATA_MAILTEMPLATES, "public" => PATH_DATA_PUBLIC);
$flagProjectUid = false;
//Query
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\BpmnProjectPeer::PRJ_UID);
if ($projectUid != "") {
$criteria->add(
$criteria->getNewCriterion(\BpmnProjectPeer::PRJ_UID, $arrayProjectUid, \Criteria::NOT_IN)->addAnd(
$criteria->getNewCriterion(\BpmnProjectPeer::PRJ_UID, $projectUid, \Criteria::EQUAL))
);
} else {
$criteria->add(\BpmnProjectPeer::PRJ_UID, $arrayProjectUid, \Criteria::NOT_IN);
}
$rsCriteria = \BpmnProjectPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
foreach ($arrayPath as $key => $value) {
$path = $key;
$dir = $value . $row["PRJ_UID"];
if (is_dir($dir)) {
if ($dirh = opendir($dir)) {
while (($file = readdir($dirh)) !== false) {
if ($file != "" && $file != "." && $file != "..") {
$f = $dir . PATH_SEP . $file;
if (is_file($f)) {
$arrayProcessFilesData = $this->getFileManagerUid($f);
if (is_null($arrayProcessFilesData["PRF_UID"])) {
rename($dir . PATH_SEP . $file, $dir . PATH_SEP . $file . ".tmp");
$arrayData = array(
"prf_path" => $path,
"prf_filename" => $file,
"prf_content" => ""
);
$arrayData = $this->addProcessFilesManager($row["PRJ_UID"], "00000000000000000000000000000001", $arrayData);
rename($dir . PATH_SEP . $file . ".tmp", $dir . PATH_SEP . $file);
}
}
}
}
closedir($dirh);
}
}
}
$arrayProjectUid[$row["PRJ_UID"]] = $row["PRJ_UID"];
$flagProjectUid = true;
}
//Update PROCESS_FILES_CHECKED
if ($flagProjectUid) {
$result = $conf->update(array(
"CFG_UID" => "PROCESS_FILES_CHECKED",
"OBJ_UID" => "",
"CFG_VALUE" => serialize($arrayProjectUid),
//.........这里部分代码省略.........