--
-- notification_reply__new/11
--
create or replace function notification_reply__new(
  integer,
  integer,
  integer,
  integer,
  character varying,
  text,
  timestamp with time zone,
  timestamp with time zone,
  integer,
  character varying,
  integer
) returns int4 as $$

DECLARE
        p_reply_id                      alias for $1;
        p_object_id                     alias for $2;
        p_type_id                       alias for $3;
        p_from_user                     alias for $4;
        p_subject                       alias for $5;
        p_content                       alias for $6;
        p_reply_date                    alias for $7;
        p_creation_date                 alias for $8;
        p_creation_user                 alias for $9;
        p_creation_ip                   alias for $10;
        p_context_id                    alias for $11;
        v_reply_id                      integer;        
BEGIN
        v_reply_id:= acs_object__new (
                                    p_reply_id,
                                    'notification_reply',
                                    p_creation_date,
                                    p_creation_user,
                                    p_creation_ip,
                                    p_context_id
                                    );

        insert into notification_replies
        (reply_id, object_id, type_id, from_user, subject, content, reply_date)
        values
        (v_reply_id, p_object_id, p_type_id, p_from_user, p_subject, p_content, p_reply_date);


        return v_reply_id;
END;
$$ language plpgsql;