http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10363

--- Comment #5 from Jonathan Druart <[email protected]> ---
(In reply to comment #4)

Srdjan,

> I'm not sure if there's a consensus re constructors in the Koha namespace
> and use of Class::Accessor. I believe it is rarely necessary to provide
> new() in those cases.

Class:Accessor is already used in many places in the Koha namespace.

> I suggest:
> * remove new() constructors all together, Koha::AuthorisedValue->new({av =>
> $av}) is unnecessary cause it is equivalent to
> Koha::AuthorisedValue->new($av}

The Koha::AuthorisedValue->new can be called directly with the $av (which
contains all values) or just with an id or category/value. These different ways
to build an object forced me to have a "new" routine. But maybe I don't see
concretely what you say :-/

> * upgrade fetch(key) to constructors, passing the key values; this way
> Koha::AuthorisedValues->new() becomes Koha::AuthorisedValues->fetch()

Yes but, like as before, sometimes we don't want to do a select in DB (when the
object is called from Koha::AuthorisedValues).

> * if you need to reload(), make those methods, and make reload() and fetch()
> call _fetch(key)

I think I don't have the need to reload.

> In general, has there been a discussion on using DBIx::Class or similar?

Yes, but it seems that nobody strongly supports the integration into Koha.

-- 
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