File: Constructor.pm

package info (click to toggle)
libdbix-class-perl 0.07003-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,396 kB
  • ctags: 764
  • sloc: perl: 7,046; sql: 217; makefile: 43
file content (18 lines) | stat: -rw-r--r-- 339 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package # hide from PAUSE
    DBIx::Class::CDBICompat::Constructor;

use strict;
use warnings;

sub add_constructor {
  my ($class, $meth, $sql) = @_;
  $class = ref $class if ref $class;
  no strict 'refs';
  *{"${class}::${meth}"} =
    sub {
      my ($class, @args) = @_;
      return $class->search_literal($sql, @args);
    };
}

1;