Koha::Objects::Limit::LibraryGroup - Generic library group limit handling class
use base qw(Koha::Objects Koha::Objects::Limit::LibraryGroup);
my $objects = Koha::Objects->search_with_library_group_limits(
$params, $attributes, $library_id, $ft_column
);
This class is provided as a generic way of handling library group limits for Koha::Objects-based classes in Koha.
This class must always be subclassed. The object class must implement _library_limits() (from Koha::Object::Limit::Library) as this method reuses the same junction table but expands the branchcode match to all libraries in the user's qualifying groups. A new _library_group_limits() method unwraps that information and also provides the 'C <ft_*> property that the groups should be identified by.
my $results = $objects->search_with_library_group_limits( $params, $attributes, $library_id, $ft_column );
Searches objects respecting library group limits. For the given $library_id (defaults to the logged-in user's branch), finds all root library groups where $ft_column is enabled and the user's library is a member at any depth, then returns objects whose junction-table entry matches any branchcode in the whole tree under those roots (or has no limit at all). A library that is not in any such tree only sees objects limited to itself.
$ft_column must be the name of an ft_* boolean column on the library_groups table (e.g. 'ft_reports').