Bug 18403: Add new method Koha::Library::Group->has_child
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 6 Apr 2017 19:10:02 +0000 (16:10 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Feb 2018 18:41:37 +0000 (15:41 -0300)
commiteb68ca2af2c9ebf32091f98380dbbd07cd7ff2e6
treea4a3c06169613015e956aa6865e185e60442319b
parent6e14fd52761f709f0644fe3a59700895cb1e7f87
Bug 18403: Add new method Koha::Library::Group->has_child

This is more a follow-up for bug 15707. It could be moved on its own bug report
if necessary.

IMPORTANT NOTE: At the moment the feature only works for 1 level depth, see
bug 15707 comment 166+ for the discussion

It means that if we have:
 root_group
     + groupA
         + groupA1
             + groupA1_library2
         + groupA_library1
         + groupA2
     + groupB
         + groupB_library1
groupA1_library2 is not considered a child of groupA1.
Note that this can change.

Test plan:
  prove t/db_dependent/LibraryGroups.t
should return green

Signed-off-by: Signed-off-by: Jon McGowan <jon.mcgowan@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Library/Group.pm
t/db_dependent/LibraryGroups.t