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

Tomás Cohen Arazi <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #10 from Tomás Cohen Arazi <[email protected]> ---
Hi Ruben,

(In reply to Ruben Norori from comment #9)
> I have the definitive solution:
> First we must add two new procedures, functions, methods, which consult in
> the database the registry homebranch.

I didn't go deep into the problem you're trying to solve, but I suggest you
don't introduce new subs, but use the current api instead.

We have a (sort of) DAO class called Koha::Items that exposes a ->search
method, which returns Koha::Item objects. So you can simply do something like
this:

  use Koha::Items;

  my $item = Koha::Items->find( $barcode );

->find gets an id column to find the row and create the object. 'barcode' is a
unique key, so this works.

Now you have a Koha::Item object, representing the item with the passed
barcode. You can then use it like:

  my $homebranch = $item->homebranch;

Hope it clarifies! This conversations are easier on the koha-devel list or on
the IRC channel.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to