This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package My::Project::DB::Result::Person; | |
use strict; | |
use warnings; | |
1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DAO::Example::Model::DB; | |
use strict; | |
use warnings; | |
use base 'Catalyst::Model::DBIC::Schema'; | |
1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rename this file to DAO::Example.yml and put a : in front of "name" if | |
# you want to use yaml like in old versions of Catalyst | |
name DAO::Example | |
<model::db> | |
schema_class DAO::Example::DB | |
connect_info dbi:SQLite:dao_example.db | |
connect_info username | |
connect_info password | |
</model::db> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DAO::Example::DB; | |
use strict; | |
use warnings; | |
use base qw/DBIx::Class::Schema/; | |
__PACKAGE__->load_namespaces( default_resultset_class => '+DAO::Example::DB::Base::ResultSet' ); | |
1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DAO::Example::DB::ResultSet::Person; | |
use strict; | |
use warnings; | |
use base qw/DAO::Example::DB::Base::ResultSet/; | |
sub by_username { | |
my ( $rs, $username ) = @_; | |
return $rs->search( { 'me.username' => $username }, { key => 'unique_username' } ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DAO::Example::DB::Base::ResultSet; | |
use strict; | |
use warnings; | |
use base qw/DBIx::Class::ResultSet::HashRef DAO::Example::DB::Base::Any/; | |
sub active { | |
my ($rs) = @_; | |
return $rs->search( { 'me.active' => 1 } ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DAO::Example::Controller::Root; | |
use strict; | |
use warnings; | |
use parent 'Catalyst::Controller'; | |
use Data::Dumper; | |
$Data::Dumper::Sortkeys = 1; | |
__PACKAGE__->config->{namespace} = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use FindBin; | |
use lib "$FindBin::Bin/../lib"; | |
use DAO::Example::Utils qw/schema config/; | |
use Data::Dumper; | |
$Data::Dumper::Sortkeys = 1; | |
unless ( -e "$FindBin::Bin/../dao_example.db" ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DAO::Example::Utils; | |
use strict; | |
use warnings; | |
use base 'Exporter'; | |
use Config::JFDI; | |
use DAO::Example::DB; | |
use vars qw/@EXPORT_OK $schema $config/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Irssi; | |
use Glib; | |
use POE qw(Loop::Glib Session::Irssi); | |
my $VERSION = '0.1'; | |
my %IRSSI = ( | |
authors => 'Johannes Plunien', | |
contact => 'http://www.pqpq.de/contact/', |