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; } }
/** * 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; } }
/** * 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 = MessageTypeVariablePeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setMsgtvUid($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setMsgtUid($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setMsgtvName($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setMsgtvDefaultValue($arr[$keys[3]]); } }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param Connection $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(MessageTypeVariablePeer::MSGTV_UID, $pks, Criteria::IN); $objs = MessageTypeVariablePeer::doSelect($criteria, $con); } return $objs; }
/** * 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; } }