[Koha-bugs] [Bug 23893] New: Add ->new_from_api and ->set_from_api methods to Koha::Object

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 24 19:51:56 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23893

            Bug ID: 23893
           Summary: Add ->new_from_api and ->set_from_api methods to
                    Koha::Object
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: tomascohen at gmail.com
        QA Contact: testopia at bugs.koha-community.org

Now we have ->to_api, we need to add the opposite operation, so:

POST
->
my $object = Koha::Class->new_from_api( $c->validation->param('body') )->store;

PUT/PATCH
->
my $object = Koha::Class->find( $c->validation->param('object_id') );
$object->set_from_api( $c->validation->param('body') )->store;

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list