src/Service/profileService.php
protected function getDBProfile($userId, $password)
    {
        // CASE 1: simple one table query
        // SELECT role, group, pstn, divn, org FROm user_table AS t1
        // WHERE t1.userid='$userid'

        // CASE 2: intersection table user_pstn (user_role, user_divn, user_org ...), need to query multiple times
        // SELECT t1.pstnid, t2.name FROM user_pstn_table AS t1
        // JOIN pstn_table AS t2 ON t1.pstnid=t2.id
        // WHERE t1.userid='$userid'

        // CASE 3: all hierarchy info contained in one big party table, do query once, then filter on type column
        // SELECT t1.partyid, t2.name, t2.type FROM user_party_table AS t1
        // JOIN party_table AS t2 ON t1.partyid=t2.id
        // WHERE t1.userid='$userid'

        $db = Openbizx::$app->getDbConnection();
        $resultSet = $db->execute($sql);
        $sqlArr = $resultSet->fetchRow();
        // process the result
    }
protected function getDBProfile($userId, $password)
    {
        // CASE 1: simple one table query
        // SELECT role, group, pstn, divn, org FROm user_table AS t1
        // WHERE t1.userid='$userid'

        // CASE 2: intersection table user_pstn (user_role, user_divn, user_org ...), need to query multiple times
        // SELECT t1.pstnid, t2.name FROM user_pstn_table AS t1
        // JOIN pstn_table AS t2 ON t1.pstnid=t2.id
        // WHERE t1.userid='$userid'

        // CASE 3: all hierarchy info contained in one big party table, do query once, then filter on type column
        // SELECT t1.partyid, t2.name, t2.type FROM user_party_table AS t1
        // JOIN party_table AS t2 ON t1.partyid=t2.id
        // WHERE t1.userid='$userid'

        $db = Openbizx::$app->getDbConnection();
        $resultSet = $db->execute($sql);
        $sqlArr = $resultSet->fetchRow();
        // process the result
    }
Get Database profile

@todo not finish
@param <type> $userId
@param <type> $password