Пример #1
0
    /**
     * 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);
    }