public static function getCredential($userId)
    {
        $model = new User_Credential();
        $where = 'account_id = ' . $model->_toDb($userId, 'account_id');
        $creds = $model->getList(array(
            'filter' => $where
        ));
        if ($creds === false or count($creds) !== 1) {
            return false;
        }
        return $creds[0];
    }
public static function getCredential($userId)
    {
        $model = new User_Credential();
        $where = 'account_id = ' . $model->_toDb($userId, 'account_id');
        $creds = $model->getList(array(
            'filter' => $where
        ));
        if ($creds === false or count($creds) !== 1) {
            return false;
        }
        return $creds[0];
    }
public static function getCredential ( $ userId ) { $ model = new User_Credential ( ) ; $ where = 'account_id = ' . $ model -> _toDb ( $ userId , 'account_id' ) ; $ creds = $ model -> getList ( array ( 'filter' => $ where ) ) ; if ( $ creds === false or count ( $ creds ) !== 1 ) { return false ; } return $ creds [ 0 ] ; }
Returns credential for given account id
@param int $userId
@return boolean|User_Credential
Returns credential for given account id