public static function getAllMessagingTemplates(CNabuMessaging $nb_messaging)
    {
        $nb_messaging_id = nb_getMixedValue($nb_messaging, 'nb_messaging_id');
        if (is_numeric($nb_messaging_id)) {
            $retval = forward_static_call(
            array(get_called_class(), 'buildObjectListFromSQL'),
                'nb_messaging_template_id',
                'select * '
                . 'from nb_messaging_template '
               . 'where nb_messaging_id=%messaging_id$d',
                array(
                    'messaging_id' => $nb_messaging_id
                ),
                $nb_messaging
            );
        } else {
            $retval = new CNabuMessagingTemplateList();
        }
        
        return $retval;
    }