本文整理汇总了PHP中ApplicationPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationPeer::retrieveByPK方法的具体用法?PHP ApplicationPeer::retrieveByPK怎么用?PHP ApplicationPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationPeer
的用法示例。
在下文中一共展示了ApplicationPeer::retrieveByPK方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: throwExceptionIfNotExistsCase
/**
* Verify if does not exist the Case in table APPLICATION
*
* @param string $applicationUid Unique id of Case
* @param string $fieldNameForException Field name for the exception
*
* return void Throw exception if does not exist the Case in table APPLICATION
*/
public function throwExceptionIfNotExistsCase($applicationUid, $fieldNameForException)
{
try {
$obj = \ApplicationPeer::retrieveByPK($applicationUid);
if (is_null($obj)) {
throw new \Exception(\G::LoadTranslation("ID_CASE_DOES_NOT_EXIST2", array($fieldNameForException, $applicationUid)));
}
} catch (\Exception $e) {
throw $e;
}
}
示例2: Cases
#end trigger debug session.......
//$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
//Save data - Start
$oCase->updateCase($_SESSION['APPLICATION'], $Fields);
//Save data - End
//Obtain previous and next step - Start
try {
$oCase = new Cases();
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
$aPreviousStep = $oCase->getPreviousStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
} catch (Exception $e) {
}
//Obtain previous and next step - End
try {
//Add content content step - Start
$oApp = ApplicationPeer::retrieveByPK($_SESSION['APPLICATION']);
$array['APP_NUMBER'] = $APP_NUMBER;
$sTitleCase = $oApp->getAppTitle();
$array['APP_TITLE'] = $sTitleCase;
$array['CASE'] = G::LoadTranslation('ID_CASE');
$array['TITLE'] = G::LoadTranslation('ID_TITLE');
$noShowTitle = 0;
if (isset($oProcessFieds['PRO_SHOW_MESSAGE'])) {
$noShowTitle = $oProcessFieds['PRO_SHOW_MESSAGE'];
}
switch ($_GET['TYPE']) {
case 'DYNAFORM':
if ($noShowTitle == 0) {
$G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $array);
}
if (!$aPreviousStep) {
示例3: newRow
public function newRow ($data, $delPreviusUsrUid, $isInitSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false)
{
$removeList = true;
if (isset($data['REMOVED_LIST'])) {
$removeList = $data['REMOVED_LIST'];
unset($data['REMOVED_LIST']);
}
$data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid;
if (isset($data['DEL_TASK_DUE_DATE'])) {
$data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE'];
}
$criteria = new Criteria();
$criteria->addSelectColumn( ApplicationPeer::APP_NUMBER );
$criteria->addSelectColumn( ApplicationPeer::APP_UPDATE_DATE );
$criteria->add( ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
$dataset = ApplicationPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data = array_merge($data, $aRow);
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_PRO_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_TAS_TITLE'] = $aRow['CON_VALUE'];
$data['APP_PREVIOUS_USER'] = '';
if ($data['DEL_PREVIOUS_USR_UID'] != '') {
$criteria = new Criteria();
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$criteria->add( UsersPeer::USR_UID, $data['DEL_PREVIOUS_USR_UID'], Criteria::EQUAL );
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['DEL_PREVIOUS_USR_USERNAME'] = $aRow['USR_USERNAME'];
$data['DEL_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
$data['DEL_PREVIOUS_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
}
$users = new Users();
$criteria = new Criteria();
$criteria->addSelectColumn(SubApplicationPeer::DEL_INDEX_PARENT);
$criteria->add( SubApplicationPeer::APP_PARENT, $data['APP_UID'], Criteria::EQUAL );
$dataset = SubApplicationPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($dataset->next()) {
$aSub = $dataset->getRow();
if ($aSub['DEL_INDEX_PARENT'] == $data['DEL_PREVIOUS'] && !$isSelfService) {
$users->refreshTotal($data['USR_UID'], 'add', 'inbox');
self::create($data, $isSelfService);
return 1;
}
}
if (!$isInitSubprocess) {
if ($data['APP_STATUS'] == 'DRAFT') {
$users->refreshTotal($data['USR_UID'], 'add', 'draft');
} else {
$oRow = ApplicationPeer::retrieveByPK($data['APP_UID']);
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
if ($removeList) {
if ($data['DEL_INDEX'] == 2 || $aFields['APP_STATUS'] == 'DRAFT') {
$criteria = new Criteria();
$criteria->addSelectColumn(SubApplicationPeer::APP_UID);
//.........这里部分代码省略.........
示例4: remove
/**
* Remove List Paused
*
* @param type $seqName
* @return type
* @throws type
*
*/
public function remove ($app_uid, $del_index, $data_inbox)
{
$users = new Users();
$users->refreshTotal($data_inbox['USR_UID'], 'removed', 'paused');
$oRow = ApplicationPeer::retrieveByPK($app_uid);
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$data_inbox['APP_STATUS'] = $aFields['APP_STATUS'];
if ($data_inbox['APP_STATUS'] == 'TO_DO') {
$users->refreshTotal($data_inbox['USR_UID'], 'add', 'inbox');
}
$listInbox = new ListInbox();
$listInbox->newRow($data_inbox, $data_inbox['USR_UID']);
$con = Propel::getConnection( ListPausedPeer::DATABASE_NAME );
try {
$this->setAppUid($app_uid);
$this->setDelIndex($del_index);
$con->begin();
$this->delete();
$con->commit();
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
示例5: getCasesInputDocumentsBySupervisor
/**
* Check if the user is Supervisor
*
* @param string $applicationUid Unique id of Case
* @param string $userUid Unique id of User
*
* return array Return data of input documents
*/
public function getCasesInputDocumentsBySupervisor($applicationUid, $userUid)
{
try {
//Verify data Supervisor
$application = \ApplicationPeer::retrieveByPK($applicationUid);
$flagSupervisor = 0;
$supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$processSupervisor = $supervisor->getProcessSupervisors($application->getProUid(), "ASSIGNED");
$arraySupervisor = $processSupervisor["data"];
foreach ($arraySupervisor as $value) {
if (!empty($value["usr_uid"]) && $value["usr_uid"] == $userUid) {
$flagSupervisor = 1;
break;
}
}
$user = new \Users();
$appDocument = new \AppDocument();
$configuraction = new \Configurations();
$confEnvSetting = $configuraction->getFormats();
$arrayInputDocument = array();
//Query
$criteria = $this->getAppDocumentCriteriaByData($applicationUid);
$rsCriteria = \AppDocumentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
/*----------------------------------********---------------------------------*/
$licensedFeatures =& \PMLicensedFeatures::getSingleton();
$enablePMGmail = false;
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
\G::LoadClass("pmDrive");
$pmDrive = new \PMDrive();
$enablePMGmail = $pmDrive->getStatusService();
}
/*----------------------------------********---------------------------------*/
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayUserData = $user->load($row["USR_UID"]);
$arrayAppDocument = $appDocument->load($row["APP_DOC_UID"], $row["DOC_VERSION"]);
$row["APP_DOC_FILENAME"] = $arrayAppDocument["APP_DOC_FILENAME"];
$row["APP_DOC_CREATE_USER"] = $configuraction->usersNameFormatBySetParameters($confEnvSetting["format"], $arrayUserData["USR_USERNAME"], $arrayUserData["USR_FIRSTNAME"], $arrayUserData["USR_LASTNAME"]);
$row["APP_DOC_LINK"] = "cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
/*----------------------------------********---------------------------------*/
//change donwload link - drive
$driveDownload = @unserialize($arrayAppDocument['APP_DOC_DRIVE_DOWNLOAD']);
if ($driveDownload !== false && is_array($driveDownload) && $enablePMGmail) {
if (array_key_exists('INPUT', $driveDownload)) {
$row['APP_DOC_LINK'] = $driveDownload['INPUT'];
} else {
if (array_key_exists('ATTACHED', $driveDownload)) {
$row['APP_DOC_LINK'] = $driveDownload['ATTACHED'];
}
}
}
/*----------------------------------********---------------------------------*/
$arrayInputDocument[] = $this->getAppDocumentDataFromRecord($row);
}
if (!empty($arrayInputDocument) && $flagSupervisor == 0) {
throw new \Exception(\G::LoadTranslation("ID_USER_IS_NOT_SUPERVISOR"));
}
//Return
return $arrayInputDocument;
} catch (\Exception $e) {
throw $e;
}
}
示例6: throwExceptionIfHaventPermissionToDelete
/**
* Check if the user has permissions
*
* @param string $applicationUid Unique id of Case
* @param string $delIndex Delegation index
* @param string $userUid Unique id of User
* @param string $appDocumentUid
*
* return void Throw exception the user does not have permission to delete
*/
public function throwExceptionIfHaventPermissionToDelete($applicationUid, $delIndex, $userUid, $appDocumentUid)
{
try {
//Verify data inbox
$case = new \ProcessMaker\BusinessModel\Cases();
$arrayResult = $case->getStatusInfo($applicationUid, $delIndex, $userUid);
$flagInbox = 1;
if (empty($arrayResult) || !preg_match("/^(?:TO_DO|DRAFT)$/", $arrayResult["APP_STATUS"])) {
$flagInbox = 0;
}
//Verify data permission
$flagPermission = 0;
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\AppDocumentPeer::DOC_UID);
$criteria->add(\AppDocumentPeer::APP_DOC_UID, $appDocumentUid, \Criteria::EQUAL);
$criteria->add(\AppDocumentPeer::APP_UID, $applicationUid, \Criteria::EQUAL);
$criteria->add(\AppDocumentPeer::APP_DOC_TYPE, "OUTPUT", \Criteria::EQUAL);
$rsCriteria = \AppDocumentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$outputDocumentUid = $row["DOC_UID"];
$application = \ApplicationPeer::retrieveByPK($applicationUid);
//Criteria
$criteria2 = new \Criteria("workflow");
$criteria2->addSelectColumn(\ObjectPermissionPeer::OP_UID);
$criteria2->add(\ObjectPermissionPeer::PRO_UID, $application->getProUid(), \Criteria::EQUAL);
$criteria2->add(\ObjectPermissionPeer::OP_OBJ_TYPE, "OUTPUT", \Criteria::EQUAL);
$criteria2->add(
$criteria2->getNewCriterion(\ObjectPermissionPeer::OP_OBJ_UID, $outputDocumentUid, \Criteria::EQUAL)->addOr(
$criteria2->getNewCriterion(\ObjectPermissionPeer::OP_OBJ_UID, "0", \Criteria::EQUAL))->addOr(
$criteria2->getNewCriterion(\ObjectPermissionPeer::OP_OBJ_UID, "", \Criteria::EQUAL))
);
$criteria2->add(\ObjectPermissionPeer::OP_ACTION, "DELETE", \Criteria::EQUAL);
//User
$criteriaU = clone $criteria2;
$criteriaU->add(\ObjectPermissionPeer::OP_USER_RELATION, 1, \Criteria::EQUAL);
$criteriaU->add(\ObjectPermissionPeer::USR_UID, $userUid, \Criteria::EQUAL);
$rsCriteriaU = \ObjectPermissionPeer::doSelectRS($criteriaU);
$rsCriteriaU->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteriaU->next()) {
$flagPermission = 1;
}
//Group
if ($flagPermission == 0) {
$criteriaG = clone $criteria2;
$criteriaG->add(\ObjectPermissionPeer::OP_USER_RELATION, 2, \Criteria::EQUAL);
$criteriaG->addJoin(\ObjectPermissionPeer::USR_UID, \GroupUserPeer::GRP_UID, \Criteria::LEFT_JOIN);
$criteriaG->add(\GroupUserPeer::USR_UID, $userUid, \Criteria::EQUAL);
$rsCriteriaG = \ObjectPermissionPeer::doSelectRS($criteriaG);
$rsCriteriaG->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteriaG->next()) {
$flagPermission = 1;
}
}
}
if ($flagInbox == 1) {
if ($flagPermission == 0) {
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION_DELETE_OUTPUT_DOCUMENT", array($userUid)));
}
} else {
if ($flagPermission == 0) {
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION_DELETE_OUTPUT_DOCUMENT", array($userUid)));
}
}
} catch (\Exception $e) {
throw $e;
//.........这里部分代码省略.........
示例7: exists
public function exists($sAppUid)
{
$oApplicaton = ApplicationPeer::retrieveByPK($sAppUid);
return !is_null($oApplicaton);
}
示例8: executeView
/**
* CODE: application_view
*/
public function executeView(sfWebRequest $request)
{
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Volunteer'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
$this->app = ApplicationPeer::retrieveByPK($request->getParameter('id'));
$this->forward404Unless($this->app);
$this->member = $this->app->getMember();
$this->person = $this->member->getPerson();
$this->medical_classes = array_merge(array(0 => 'Non-Pilot'), sfConfig::get('app_pilot_medical_classes', array()));
$this->premium_choices = sfConfig::get('app_premium_choices', array());
$this->premium_sizes = sfConfig::get('app_premium_sizes', array());
}
示例9: getCasesInputDocumentsBySupervisor
/**
* Check if the user is Supervisor
*
* @param string $applicationUid Unique id of Case
* @param string $userUid Unique id of User
*
* return array Return data of input documents
*/
public function getCasesInputDocumentsBySupervisor($applicationUid, $userUid)
{
try {
//Verify data Supervisor
$application = \ApplicationPeer::retrieveByPK($applicationUid);
$flagSupervisor = 0;
$supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arraySupervisor = $supervisor->getProcessSupervisors($application->getProUid());
foreach ($arraySupervisor as $value) {
if($value["usr_uid"] == $userUid) {
$flagSupervisor = 1;
break;
}
}
$user = new \Users();
$appDocument = new \AppDocument();
$configuraction = new \Configurations();
$confEnvSetting = $configuraction->getFormats();
$arrayInputDocument = array();
//Query
$criteria = $this->getAppDocumentCriteriaByData($applicationUid);
$rsCriteria = \AppDocumentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayUserData = $user->load($row["USR_UID"]);
$arrayAppDocument = $appDocument->load($row["APP_DOC_UID"], $row["DOC_VERSION"]);
$row["APP_DOC_FILENAME"] = $arrayAppDocument["APP_DOC_FILENAME"];
$row["APP_DOC_CREATE_USER"] = $configuraction->usersNameFormatBySetParameters($confEnvSetting["format"], $arrayUserData["USR_USERNAME"], $arrayUserData["USR_FIRSTNAME"], $arrayUserData["USR_LASTNAME"]);
$row["APP_DOC_LINK"] = "cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$arrayInputDocument[] = $this->getAppDocumentDataFromRecord($row);
}
if (!empty($arrayInputDocument) && $flagSupervisor == 0) {
throw new \Exception(\G::LoadTranslation("ID_USER_IS_NOT_SUPERVISOR"));
}
//Return
return $arrayInputDocument;
} catch (\Exception $e) {
throw $e;
}
}
示例10: delete
/**
* Implementation for 'DELETE' method for Rest API
*
* @param mixed $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 delete($appUid)
{
$conn = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
try {
$conn->begin();
$obj = ApplicationPeer::retrieveByPK($appUid);
if (!is_object($obj)) {
throw new RestException(412, 'Record does not exist.');
}
$obj->delete();
$conn->commit();
} catch (Exception $e) {
$conn->rollback();
throw new RestException(412, $e->getMessage());
}
}
示例11: delete
/**
* Implementation for 'DELETE' method for Rest API
*
* @param mixed $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 delete($appUid)
{
$conn = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
try {
$conn->begin();
$obj = ApplicationPeer::retrieveByPK($appUid);
if (!is_object($obj)) {
throw new RestException(412, G::LoadTranslation('ID_RECORD_DOES_NOT_EXIST'));
}
$obj->delete();
$conn->commit();
} catch (Exception $e) {
$conn->rollback();
throw new RestException(412, $e->getMessage());
}
}