public static function getCountProspectsOfUser(
        $nb_icontact,
        $nb_user,
        CNabuIContactProspectStatusType $nb_status_type = null
    ) : int {
        if (is_numeric($nb_icontact_id = nb_getMixedValue($nb_icontact, 'nb_icontact_id')) &&
            is_numeric($nb_user_id = nb_getMixedValue($nb_user, 'nb_user_id'))
        ) {
            $status_id = nb_getMixedValue($nb_status_type, 'nb_icontact_prospect_status_type_id');
            $retval = CNabuEngine::getEngine()->getMainDB()->getQueryAsCount(
                'nb_icontact_prospect ip, nb_icontact i',
                null,
                "ip.nb_icontact_id=i.nb_icontact_id AND i.nb_icontact_id=$nb_icontact_id"
                ." AND ip.nb_user_id=$nb_user_id"
                . (is_numeric($status_id) ? " AND ip.nb_icontact_prospect_status_id=$status_id " : '')
            );
        } else {
            $retval = 0;
        }

        return $retval;
    }
public static function getCountProspectsOfUser(
        $nb_icontact,
        $nb_user,
        CNabuIContactProspectStatusType $nb_status_type = null
    ) : int {
        if (is_numeric($nb_icontact_id = nb_getMixedValue($nb_icontact, 'nb_icontact_id')) &&
            is_numeric($nb_user_id = nb_getMixedValue($nb_user, 'nb_user_id'))
        ) {
            $status_id = nb_getMixedValue($nb_status_type, 'nb_icontact_prospect_status_type_id');
            $retval = CNabuEngine::getEngine()->getMainDB()->getQueryAsCount(
                'nb_icontact_prospect ip, nb_icontact i',
                null,
                "ip.nb_icontact_id=i.nb_icontact_id AND i.nb_icontact_id=$nb_icontact_id"
                ." AND ip.nb_user_id=$nb_user_id"
                . (is_numeric($status_id) ? " AND ip.nb_icontact_prospect_status_id=$status_id " : '')
            );
        } else {
            $retval = 0;
        }

        return $retval;
    }
public static function getCountProspectsOfUser ( $ nb_icontact , $ nb_user , CNabuIContactProspectStatusType $ nb_status_type = null ) : int { if ( is_numeric ( $ nb_icontact_id = nb_getMixedValue ( $ nb_icontact , 'nb_icontact_id' ) ) && is_numeric ( $ nb_user_id = nb_getMixedValue ( $ nb_user , 'nb_user_id' ) ) ) { $ status_id = nb_getMixedValue ( $ nb_status_type , 'nb_icontact_prospect_status_type_id' ) ; $ retval = CNabuEngine :: getEngine ( ) -> getMainDB ( ) -> getQueryAsCount ( 'nb_icontact_prospect ip, nb_icontact i' , null , "ip.nb_icontact_id=i.nb_icontact_id AND i.nb_icontact_id=$nb_icontact_id" . " AND ip.nb_user_id=$nb_user_id" . ( is_numeric ( $ status_id ) ? " AND ip.nb_icontact_prospect_status_id=$status_id " : '' ) ) ; } else { $ retval = 0 ; } return $ retval ; }
Get the count of related Prospects of a User.
@param mixed $nb_icontact A CNabuDataObject containing a field called nb_icontact_prospect_id or an ID
where to count Prospects.
@param mixed $nb_user User instance that holds Prospects or a CNabuDataObject containing a field called
nb_user_id or an ID.
@param CNabuIContactProspectStatusType|null $nb_status_type If setted, the list is filtered using this status.
@return int Returns the count of all Prospects found.
Get the count of related Prospects of a User .