/** * Load an array of RoleModule objects, based on the RoleId and Access Flag * @param int intRoleId * @param bit blnAccessFlag * @param string $strOrderBy * @param string $strLimit * @param array $objExpansionMap map of referenced columns to be immediately expanded via early-binding * @return RoleModule[] */ public static function LoadArrayByRoleIdAccessFlag($intRoleId, $blnAccessFlag, $strOrderBy = null, $strLimit = null, $objExpansionMap = null) { // Call to ArrayQueryHelper to Get Database Object and Get SQL Clauses RoleModule::ArrayQueryHelper($strOrderBy, $strLimit, $strLimitPrefix, $strLimitSuffix, $strExpandSelect, $strExpandFrom, $objExpansionMap, $objDatabase); // Properly Escape All Input Parameters using Database->SqlVariable() $intRoleId = $objDatabase->SqlVariable($intRoleId); $blnAccessFlag = $objDatabase->SqlVariable($blnAccessFlag); // Setup the SQL Query $strQuery = sprintf(' SELECT %s `role_module`.* %s FROM `role_module` AS `role_module` %s WHERE `role_module`.`role_id` = %s AND `role_module`.`access_flag` = %s %s %s', $strLimitPrefix, $strExpandSelect, $strExpandFrom, $intRoleId, $blnAccessFlag, $strOrderBy, $strLimitSuffix); // Perform the Query and Instantiate the Result $objDbResult = $objDatabase->Query($strQuery); return RoleModule::InstantiateDbResult($objDbResult); }
/** * Static Qcodo Query method to query for an array of RoleModule objects. * Uses BuildQueryStatment to perform most of the work. * @param QQCondition $objConditions any conditions on the query, itself * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with * @return RoleModule[] the queried objects as an array */ public static function QueryArray(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) { // Get the Query Statement try { $strQuery = RoleModule::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // Perform the Query and Instantiate the Array Result $objDbResult = $objQueryBuilder->Database->Query($strQuery); return RoleModule::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes); }
/** * Gets the historical journal for an object from the log database. * Objects will have VirtualAttributes available to lookup login, date, and action information from the journal object. * @param integer intRoleModuleId * @return RoleModule[] */ public static function GetJournalForId($intRoleModuleId) { $objDatabase = RoleModule::GetDatabase()->JournalingDatabase; $objResult = $objDatabase->Query('SELECT * FROM role_module WHERE role_module_id = ' . $objDatabase->SqlVariable($intRoleModuleId) . ' ORDER BY __sys_date'); return RoleModule::InstantiateDbResult($objResult); }