Ejemplo n.º 1
0
    /**
     * Load a RoleModule from PK Info
     * @param integer $intRoleId
     * @param integer $intModuleId
     * @return RoleModule
     */
    public static function LoadByRoleIdModuleId($intRoleId, $intModuleId)
    {
        // Call to ArrayQueryHelper to Get Database Object and Get SQL Clauses
        RoleModule::QueryHelper($objDatabase);
        // Properly Escape All Input Parameters using Database->SqlVariable()
        $intRoleId = $objDatabase->SqlVariable($intRoleId);
        $intModuleId = $objDatabase->SqlVariable($intModuleId);
        // Setup the SQL Query
        $strQuery = sprintf('
				SELECT
					`role_module_id`,
					`role_id`,
					`module_id`,
					`access_flag`,
					`created_by`,
					`creation_date`,
					`modified_by`,
					`modified_date`
				FROM
					`role_module`
				WHERE
					`role_id` = %s
					AND module_id = %s', $intRoleId, $intModuleId);
        // Perform the Query and Instantiate the Row
        $objDbResult = $objDatabase->Query($strQuery);
        return RoleModule::InstantiateDbRow($objDbResult->GetNextRow());
    }