public static function findByKey($nb_messaging, $key)
    {
        $nb_messaging_id = nb_getMixedValue($nb_messaging, 'nb_messaging_id');
        if (is_numeric($nb_messaging_id)) {
            $retval = CNabuMessagingService::buildObjectFromSQL(
                    'select * '
                    . 'from nb_messaging_service '
                   . 'where nb_messaging_id=%messaging_id$d '
                     . "and nb_messaging_service_key='%key\$s'",
                    array(
                        'messaging_id' => $nb_messaging_id,
                        'key' => $key
                    )
            );
        } else {
            $retval = null;
        }
        
        return $retval;
    }