protected function getRules($iGroupId)
    {
        $sCacheKey    = 'password-rules-' . $iGroupId;
        $aCacheResult = $this->getCache($sCacheKey);
        if (!empty($aCacheResult)) {
            return $aCacheResult;
        }

        $oDb = Factory::service('Database');
        $oDb->select('password_rules');
        $oDb->where('id', $iGroupId);
        $oResult = $oDb->get(NAILS_DB_PREFIX . 'user_group');

        if ($oResult->num_rows() === 0) {
            return [];
        }

        $oPwRules = json_decode($oResult->row()->password_rules);

        $aOut                 = [];
        $aOut['min']          = !empty($oPwRules->min) ? $oPwRules->min : null;
        $aOut['max']          = !empty($oPwRules->max) ? $oPwRules->max : null;
        $aOut['expiresAfter'] = !empty($oPwRules->expiresAfter) ? $oPwRules->expiresAfter : null;
        $aOut['requirements'] = !empty($oPwRules->requirements) ? $oPwRules->requirements : [];
        $aOut['banned']       = !empty($oPwRules->banned) ? $oPwRules->banned : [];

        $this->setCache($sCacheKey, $aOut);

        return $aOut;
    }
protected function getRules($iGroupId)
    {
        $sCacheKey    = 'password-rules-' . $iGroupId;
        $aCacheResult = $this->getCache($sCacheKey);
        if (!empty($aCacheResult)) {
            return $aCacheResult;
        }

        $oDb = Factory::service('Database');
        $oDb->select('password_rules');
        $oDb->where('id', $iGroupId);
        $oResult = $oDb->get(NAILS_DB_PREFIX . 'user_group');

        if ($oResult->num_rows() === 0) {
            return [];
        }

        $oPwRules = json_decode($oResult->row()->password_rules);

        $aOut                 = [];
        $aOut['min']          = !empty($oPwRules->min) ? $oPwRules->min : null;
        $aOut['max']          = !empty($oPwRules->max) ? $oPwRules->max : null;
        $aOut['expiresAfter'] = !empty($oPwRules->expiresAfter) ? $oPwRules->expiresAfter : null;
        $aOut['requirements'] = !empty($oPwRules->requirements) ? $oPwRules->requirements : [];
        $aOut['banned']       = !empty($oPwRules->banned) ? $oPwRules->banned : [];

        $this->setCache($sCacheKey, $aOut);

        return $aOut;
    }
protected function getRules ( $ iGroupId ) { $ sCacheKey = 'password-rules-' . $ iGroupId ; $ aCacheResult = $ this -> getCache ( $ sCacheKey ) ; if ( ! empty ( $ aCacheResult ) ) { return $ aCacheResult ; } $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> select ( 'password_rules' ) ; $ oDb -> where ( 'id' , $ iGroupId ) ; $ oResult = $ oDb -> get ( NAILS_DB_PREFIX . 'user_group' ) ; if ( $ oResult -> num_rows ( ) === 0 ) { return [ ] ; } $ oPwRules = json_decode ( $ oResult -> row ( ) -> password_rules ) ; $ aOut = [ ] ; $ aOut [ 'min' ] = ! empty ( $ oPwRules -> min ) ? $ oPwRules -> min : null ; $ aOut [ 'max' ] = ! empty ( $ oPwRules -> max ) ? $ oPwRules -> max : null ; $ aOut [ 'expiresAfter' ] = ! empty ( $ oPwRules -> expiresAfter ) ? $ oPwRules -> expiresAfter : null ; $ aOut [ 'requirements' ] = ! empty ( $ oPwRules -> requirements ) ? $ oPwRules -> requirements : [ ] ; $ aOut [ 'banned' ] = ! empty ( $ oPwRules -> banned ) ? $ oPwRules -> banned : [ ] ; $ this -> setCache ( $ sCacheKey , $ aOut ) ; return $ aOut ; }
Returns the app's raw password rules as an array

@param integer $iGroupId The group who's rules to fetch

@return array
Returns the app s raw password rules as an array