diff options
author | Yorhel <git@yorhel.nl> | 2009-02-15 11:55:48 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-02-15 11:55:48 +0100 |
commit | 18672f0ae09f3669f483bb214f672932f57fe12f (patch) | |
tree | b6d5a62763b80eb9bd7c8f77904547840f8044a5 /lib/VNDB/DB/Tags.pm | |
parent | 678b6c3089cd4372ca9e4bd48e629d46a6549c1a (diff) |
Check for existing tag with the same name on tag creation or edit
Diffstat (limited to 'lib/VNDB/DB/Tags.pm')
-rw-r--r-- | lib/VNDB/DB/Tags.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Tags.pm b/lib/VNDB/DB/Tags.pm index a4dc712b..9b9a94ae 100644 --- a/lib/VNDB/DB/Tags.pm +++ b/lib/VNDB/DB/Tags.pm @@ -8,7 +8,7 @@ use Exporter 'import'; our @EXPORT = qw|dbTagGet dbTagEdit dbTagAdd|; -# %options->{ id page results order what } +# %options->{ id name page results order what } # what: parents childs(n) sub dbTagGet { my $self = shift; @@ -23,6 +23,8 @@ sub dbTagGet { my %where = ( $o{id} ? ( 't.id = ?' => $o{id} ) : (), + $o{name} ? ( + 'lower(t.name) = ?' => lc $o{name} ) : (), ); my($r, $np) = $self->dbPage(\%o, q| |