/** * Generate data * * return void */ public function generateData() { try { G::LoadClass("case"); AppAssignSelfServiceValuePeer::doDeleteAll(); //Delete all records //Generate data $case = new Cases(); $criteria = new Criteria("workflow"); $criteria->addSelectColumn(AppDelegationPeer::APP_UID); $criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX); $criteria->addSelectColumn(ApplicationPeer::APP_DATA); $criteria->addSelectColumn(AppDelegationPeer::PRO_UID); $criteria->addSelectColumn(TaskPeer::TAS_UID); $criteria->addSelectColumn(TaskPeer::TAS_GROUP_VARIABLE); $criteria->addJoin(AppDelegationPeer::APP_UID, ApplicationPeer::APP_UID, Criteria::LEFT_JOIN); $criteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); $criteria->add(TaskPeer::TAS_ASSIGN_TYPE, "SELF_SERVICE", Criteria::EQUAL); $criteria->add(TaskPeer::TAS_GROUP_VARIABLE, "", Criteria::NOT_EQUAL); $criteria->add(AppDelegationPeer::USR_UID, "", Criteria::EQUAL); $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", Criteria::EQUAL); $rsCriteria = AppDelegationPeer::doSelectRS($criteria); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); while ($rsCriteria->next()) { $row = $rsCriteria->getRow(); $applicationData = $case->unserializeData($row["APP_DATA"]); $taskGroupVariable = trim($row["TAS_GROUP_VARIABLE"], " @#"); if ($taskGroupVariable != "" && isset($applicationData[$taskGroupVariable]) && trim($applicationData[$taskGroupVariable]) != "") { $this->create($row["APP_UID"], $row["DEL_INDEX"], array("PRO_UID" => $row["PRO_UID"], "TAS_UID" => $row["TAS_UID"], "GRP_UID" => trim($applicationData[$taskGroupVariable]))); } } } catch (Exception $e) { throw $e; } }
/** * Populates the object using an array. * * This is particularly useful when populating an object from one of the * request arrays (e.g. $_POST). This method goes through the column * names, checking to see whether a matching key exists in populated * array. If so the setByName() method is called for that column. * * You can specify the key type of the array by additionally passing one * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId') * * @param array $arr An array to populate the object from. * @param string $keyType The type of keys the array uses. * @return void */ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = AppAssignSelfServiceValuePeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setAppUid($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setDelIndex($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setProUid($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setTasUid($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setGrpUid($arr[$keys[4]]); } }
public function getSelfServiceCasesByEvaluate($userUid) { try { G::LoadClass("groups"); $arrayAppAssignSelfServiceValueData = array(); //Get APP_UIDs $group = new Groups(); $arrayUid = $group->getActiveGroupsForAnUser($userUid); //Set UIDs of Groups (Groups of User) $arrayUid[] = $userUid; //Set UID of User $criteria = new Criteria("workflow"); $criteria->setDistinct(); $criteria->addSelectColumn(AppAssignSelfServiceValuePeer::APP_UID); $criteria->addSelectColumn(AppAssignSelfServiceValuePeer::DEL_INDEX); $criteria->addSelectColumn(AppAssignSelfServiceValuePeer::TAS_UID); $arrayCondition = array(); $arrayCondition[] = array(AppAssignSelfServiceValuePeer::APP_UID, AppDelegationPeer::APP_UID, Criteria::EQUAL); $arrayCondition[] = array(AppAssignSelfServiceValuePeer::DEL_INDEX, AppDelegationPeer::DEL_INDEX, Criteria::EQUAL); $arrayCondition[] = array(AppAssignSelfServiceValuePeer::TAS_UID, AppDelegationPeer::TAS_UID, Criteria::EQUAL); $criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN); $criteria->add(AppDelegationPeer::USR_UID, "", Criteria::EQUAL); $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", Criteria::EQUAL); $criterionAux = null; foreach ($arrayUid as $value) { if (is_null($criterionAux)) { $criterionAux = $criteria->getNewCriterion(AppAssignSelfServiceValuePeer::GRP_UID, "%$value%", Criteria::LIKE); } else { $criterionAux = $criteria->getNewCriterion(AppAssignSelfServiceValuePeer::GRP_UID, "%$value%", Criteria::LIKE)->addOr($criterionAux); } } $criteria->add($criterionAux); $rsCriteria = AppAssignSelfServiceValuePeer::doSelectRS($criteria); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); while ($rsCriteria->next()) { $row = $rsCriteria->getRow(); $arrayAppAssignSelfServiceValueData[] = array( "APP_UID" => $row["APP_UID"], "DEL_INDEX" => $row["DEL_INDEX"], "TAS_UID" => $row["TAS_UID"] ); } //Return return $arrayAppAssignSelfServiceValueData; } catch (Exception $e) { throw $e; } }
/** * The returned array will contain objects of the default type or * objects that inherit from the default. * * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function populateObjects(ResultSet $rs) { $results = array(); // set the class once to avoid overhead in the loop $cls = AppAssignSelfServiceValuePeer::getOMClass(); $cls = Propel::import($cls); // populate the object(s) while ($rs->next()) { $obj = new $cls(); $obj->hydrate($rs); $results[] = $obj; } return $results; }
public function getSelfServiceCasesByEvaluate($userUid) { try { G::LoadClass("groups"); $arrayApplicationUid = array(); //Get APP_UIDs $group = new Groups(); $arrayGroup = $group->getActiveGroupsForAnUser($userUid); //Get Groups of User if (count($arrayGroup) > 0) { $criteria = new Criteria("workflow"); $criteria->setDistinct(); $criteria->addSelectColumn(AppAssignSelfServiceValuePeer::APP_UID); $arrayCondition = array(); $arrayCondition[] = array(AppAssignSelfServiceValuePeer::APP_UID, AppDelegationPeer::APP_UID, Criteria::EQUAL); $arrayCondition[] = array(AppAssignSelfServiceValuePeer::DEL_INDEX, AppDelegationPeer::DEL_INDEX, Criteria::EQUAL); $arrayCondition[] = array(AppAssignSelfServiceValuePeer::TAS_UID, AppDelegationPeer::TAS_UID, Criteria::EQUAL); $criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN); $criteria->add(AppDelegationPeer::USR_UID, "", Criteria::EQUAL); $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", Criteria::EQUAL); $criteria->add(AppAssignSelfServiceValuePeer::GRP_UID, $arrayGroup, Criteria::IN); $rsCriteria = AppAssignSelfServiceValuePeer::doSelectRS($criteria); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); while ($rsCriteria->next()) { $row = $rsCriteria->getRow(); $arrayApplicationUid[] = $row["APP_UID"]; } } //Return return $arrayApplicationUid; } catch (Exception $e) { throw $e; } }