&GetBranchCategories
&GetBranchesInCategory
&ModBranchCategoryInfo
- &DelBranch
- &DelBranchCategory
&CheckCategoryUnique
&mybranch
&GetBranchesCount
return \@results;
}
-=head2 DelBranch
-
-&DelBranch($branchcode);
-
-=cut
-
-sub DelBranch {
- my ($branchcode) = @_;
- my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare("delete from branches where branchcode = ?");
- $sth->execute($branchcode);
-}
-
=head2 ModBranchCategoryInfo
&ModBranchCategoryInfo($data);
}
}
-
-=head2 DeleteBranchCategory
-
-DeleteBranchCategory($categorycode);
-
-=cut
-
-sub DelBranchCategory {
- my ($categorycode) = @_;
- my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare("delete from branchcategories where categorycode = ?");
- $sth->execute($categorycode);
-}
-
=head2 CheckBranchCategorycode
$number_rows_affected = CheckBranchCategorycode($categorycode);
use Test::More tests => 36;
use C4::Branch;
+use Koha::Libraries;
+use Koha::LibraryCategories;
BEGIN {
use FindBin;
GetBranchCategories
GetBranchesInCategory
ModBranchCategoryInfo
- DelBranch
- DelBranchCategory
CheckCategoryUnique
mybranch
GetBranchesCount)
ModBranch($b2);
is( GetBranchesCount(), $count + 2, "two branches added" );
-#Test DelBranch
-
-is( DelBranch( $b2->{branchcode} ), 1, "One row affected" );
+is( Koha::Libraries->find( $b2->{branchcode} )->delete, 1, "One row affected" );
is( GetBranchesCount(), $count + 1, "branch BRB deleted" );
#Test GetBranchName
my $category = GetBranchCategory('LIBCATCODE');
is_deeply($category, \%new_category, 'fetched newly added library category');
-#Test DelBranchCategory
-my $del = DelBranchCategory( $cat2->{categorycode} );
+my $del = Koha::LibraryCategories->find( $cat2->{categorycode} )->delete;
is( $del, 1, 'One row affected' );
$categories = GetBranchCategories();