public function getMessageTypeVariables($processUid) { try { $arrayVariable = array(); $variable = new \ProcessMaker\BusinessModel\MessageType\Variable(); //Get data $criteria = new Criteria("workflow"); $criteria->addSelectColumn(MessageTypeVariablePeer::MSGTV_UID); $criteria->addJoin(MessageTypePeer::MSGT_UID, MessageTypeVariablePeer::MSGT_UID, Criteria::LEFT_JOIN); $criteria->add(MessageTypePeer::PRJ_UID, $processUid, Criteria::EQUAL); $rsCriteria = MessageTypeVariablePeer::doSelectRS($criteria); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); while ($rsCriteria->next()) { $row = $rsCriteria->getRow(); $arrayVariable[] = $variable->getMessageTypeVariable($row["MSGTV_UID"], true); } //Return return $arrayVariable; } catch (Exception $e) { throw $e; } }
/** * Method to do selects. * * @param Criteria $criteria The Criteria object used to build the SELECT statement. * @param Connection $con * @return array Array of selected Objects * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelect(Criteria $criteria, $con = null) { return MessageTypeVariablePeer::populateObjects(MessageTypeVariablePeer::doSelectRS($criteria, $con)); }
/** * Get data of a Message-Type-Variable * * @param string $messageTypeVariableUid Unique id of Message-Type-Variable * @param bool $flagGetRecord Value that set the getting * * return array Return an array with data of a Message-Type-Variable */ public function getMessageTypeVariable($messageTypeVariableUid, $flagGetRecord = false) { try { //Verify data $this->throwExceptionIfNotExistsMessageTypeVariable($messageTypeVariableUid, $this->arrayFieldNameForException["messageTypeVariableUid"]); //Get data //SQL $criteria = $this->getMessageTypeVariableCriteria(); $criteria->add(\MessageTypeVariablePeer::MSGTV_UID, $messageTypeVariableUid, \Criteria::EQUAL); $rsCriteria = \MessageTypeVariablePeer::doSelectRS($criteria); $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); $rsCriteria->next(); $row = $rsCriteria->getRow(); //Return return !$flagGetRecord ? $this->getMessageTypeVariableDataFromRecord($row) : $row; } catch (\Exception $e) { throw $e; } }
/** * Get data of a Message-Type * * @param string $messageTypeUid Unique id of Message-Type * @param bool $flagGetRecord Value that set the getting * * return array Return an array with data of a Message-Type */ public function getMessageType($messageTypeUid, $flagGetRecord = false) { try { //Verify data $this->throwExceptionIfNotExistsMessageType($messageTypeUid, $this->arrayFieldNameForException["messageTypeUid"]); //Get data //SQL $criteria = $this->getMessageTypeCriteria(); $criteria->add(\MessageTypePeer::MSGT_UID, $messageTypeUid, \Criteria::EQUAL); $rsCriteria = \MessageTypePeer::doSelectRS($criteria); $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); $rsCriteria->next(); $row = $rsCriteria->getRow(); //Variable $arrayVariable = array(); $variable = new \ProcessMaker\BusinessModel\MessageType\Variable(); $variable->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $criteriaMessageTypeVariable = $variable->getMessageTypeVariableCriteria(); $criteriaMessageTypeVariable->add(\MessageTypeVariablePeer::MSGT_UID, $messageTypeUid, \Criteria::EQUAL); $rsCriteriaMessageTypeVariable = \MessageTypeVariablePeer::doSelectRS($criteriaMessageTypeVariable); $rsCriteriaMessageTypeVariable->setFetchmode(\ResultSet::FETCHMODE_ASSOC); while ($rsCriteriaMessageTypeVariable->next()) { $row2 = $rsCriteriaMessageTypeVariable->getRow(); if (!$flagGetRecord) { $arrayVariable[] = $variable->getMessageTypeVariableDataFromRecord($row2, false); } else { unset($row2["MSGTV_UID"]); $arrayVariable[] = $row2; } } $row["MSGT_VARIABLES"] = $arrayVariable; //Return return !$flagGetRecord ? $this->getMessageTypeDataFromRecord($row) : $row; } catch (\Exception $e) { throw $e; } }