/** * 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 = ListMyInboxPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setAppUid($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setUsrUid($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setTasUid($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setProUid($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setAppNumber($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setAppTitle($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setAppProTitle($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setAppTasTitle($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setAppCreateDate($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setAppUpdateDate($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setAppFinishDate($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setAppStatus($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setDelIndex($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { $this->setDelPreviousUsrUid($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { $this->setDelPreviousUsrUsername($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { $this->setDelPreviousUsrFirstname($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { $this->setDelPreviousUsrLastname($arr[$keys[16]]); } if (array_key_exists($keys[17], $arr)) { $this->setDelCurrentUsrUid($arr[$keys[17]]); } if (array_key_exists($keys[18], $arr)) { $this->setDelCurrentUsrUsername($arr[$keys[18]]); } if (array_key_exists($keys[19], $arr)) { $this->setDelCurrentUsrFirstname($arr[$keys[19]]); } if (array_key_exists($keys[20], $arr)) { $this->setDelCurrentUsrLastname($arr[$keys[20]]); } if (array_key_exists($keys[21], $arr)) { $this->setDelDelegateDate($arr[$keys[21]]); } if (array_key_exists($keys[22], $arr)) { $this->setDelInitDate($arr[$keys[22]]); } if (array_key_exists($keys[23], $arr)) { $this->setDelDueDate($arr[$keys[23]]); } if (array_key_exists($keys[24], $arr)) { $this->setDelPriority($arr[$keys[24]]); } }
public function loadList($usr_uid, $filters = array(), $callbackRecord = null) { $criteria = new Criteria(); $criteria->addSelectColumn(ListMyInboxPeer::APP_UID); $criteria->addSelectColumn(ListMyInboxPeer::USR_UID); $criteria->addSelectColumn(ListMyInboxPeer::TAS_UID); $criteria->addSelectColumn(ListMyInboxPeer::PRO_UID); $criteria->addSelectColumn(ListMyInboxPeer::APP_NUMBER); $criteria->addSelectColumn(ListMyInboxPeer::APP_TITLE); $criteria->addSelectColumn(ListMyInboxPeer::APP_PRO_TITLE); $criteria->addSelectColumn(ListMyInboxPeer::APP_TAS_TITLE); $criteria->addSelectColumn(ListMyInboxPeer::APP_CREATE_DATE); $criteria->addSelectColumn(ListMyInboxPeer::APP_UPDATE_DATE); $criteria->addSelectColumn(ListMyInboxPeer::APP_FINISH_DATE); $criteria->addSelectColumn(ListMyInboxPeer::APP_STATUS); $criteria->addSelectColumn(ListMyInboxPeer::DEL_INDEX); $criteria->addSelectColumn(ListMyInboxPeer::DEL_CURRENT_USR_UID); $criteria->addSelectColumn(ListMyInboxPeer::DEL_CURRENT_USR_FIRSTNAME); $criteria->addSelectColumn(ListMyInboxPeer::DEL_CURRENT_USR_LASTNAME); $criteria->addSelectColumn(ListMyInboxPeer::DEL_CURRENT_USR_USERNAME); $criteria->addSelectColumn(ListMyInboxPeer::DEL_PREVIOUS_USR_UID); $criteria->addSelectColumn(ListMyInboxPeer::DEL_PREVIOUS_USR_USERNAME); $criteria->addSelectColumn(ListMyInboxPeer::DEL_PREVIOUS_USR_FIRSTNAME); $criteria->addSelectColumn(ListMyInboxPeer::DEL_PREVIOUS_USR_LASTNAME); $criteria->addSelectColumn(ListMyInboxPeer::DEL_DELEGATE_DATE); $criteria->addSelectColumn(ListMyInboxPeer::DEL_INIT_DATE); $criteria->addSelectColumn(ListMyInboxPeer::DEL_DUE_DATE); $criteria->addSelectColumn(ListMyInboxPeer::DEL_PRIORITY); $criteria->add(ListMyInboxPeer::USR_UID, $usr_uid, Criteria::EQUAL); self::loadFilters($criteria, $filters); $sort = !empty($filters['sort']) ? $filters['sort'] : "APP_UPDATE_DATE"; $dir = isset($filters['dir']) ? $filters['dir'] : "ASC"; $start = isset($filters['start']) ? $filters['start'] : "0"; $limit = isset($filters['limit']) ? $filters['limit'] : "25"; $paged = isset($filters['paged']) ? $filters['paged'] : 1; if ($dir == "DESC") { $criteria->addDescendingOrderByColumn($sort); } else { $criteria->addAscendingOrderByColumn($sort); } if ($paged == 1) { $criteria->setLimit($limit); $criteria->setOffset($start); } $dataset = ListMyInboxPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro')); $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $data = array(); $aPriorities = array('1' => 'VL', '2' => 'L', '3' => 'N', '4' => 'H', '5' => 'VH'); while ($dataset->next()) { $aRow = is_null($callbackRecord) ? $dataset->getRow() : $callbackRecord($dataset->getRow()); $aRow['DEL_PRIORITY'] = G::LoadTranslation("ID_PRIORITY_{$aPriorities[$aRow['DEL_PRIORITY']]}"); $data[] = $aRow; } return $data; }
/** * 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(ListMyInboxPeer::APP_UID, $pks, Criteria::IN); $objs = ListMyInboxPeer::doSelect($criteria, $con); } return $objs; }