Biblio-Zotero-DB

 view release on metacpan or  search on metacpan

lib/Biblio/Zotero/DB/Schema/Result/Item.pm  view on Meta::CPAN

  },
);


__PACKAGE__->many_to_many("itemids", "item_see_also_linkeditemids", "itemid");


__PACKAGE__->many_to_many("linkeditemids", "item_see_also_linkeditemids", "linkeditemid");


__PACKAGE__->many_to_many("tagids", "item_tags", "tagid");


__PACKAGE__->many_to_many("wordids", "fulltext_item_words", "wordid");


# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-07-02 23:02:38
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OcWFl3GnRhMxSUTwxOnJCw

# NOTE: extended DBIC schema below

lib/Biblio/Zotero/DB/Schema/Result/Item.pm  view on Meta::CPAN

}

sub is_source_item {
  my $self = shift;
  !! $self->item_attachments_sourceitemids->count;
}

# TODO: document
sub tag_names {
	my ($self) = @_;
	[map { $_->name } $self->tagids];
}

# TODO: document
sub fields {
	my ($self) = @_;
	$self->item_datas_rs->fields_for_itemid($self->itemid);
}


__PACKAGE__->has_many(

lib/Biblio/Zotero/DB/Schema/Result/Item.pm  view on Meta::CPAN

Type: many_to_many

Composing rels: L</item_see_also_linkeditemids> -> itemid

=head2 linkeditemids

Type: many_to_many

Composing rels: L</item_see_also_linkeditemids> -> linkeditemid

=head2 tagids

Type: many_to_many

Composing rels: L</item_tags> -> tagid

=head2 wordids

Type: many_to_many

Composing rels: L</fulltext_item_words> -> wordid

=head2 stored_item_attachments_sourceitemids

Type: has_many

lib/Biblio/Zotero/DB/Schema/Result/ItemTag.pm  view on Meta::CPAN


use base 'DBIx::Class::Core';


__PACKAGE__->table("itemTags");


__PACKAGE__->add_columns(
  "itemid",
  { data_type => "int", is_foreign_key => 1, is_nullable => 0 },
  "tagid",
  { data_type => "int", is_foreign_key => 1, is_nullable => 0 },
);


__PACKAGE__->set_primary_key("itemid", "tagid");


__PACKAGE__->belongs_to(
  "itemid",
  "Biblio::Zotero::DB::Schema::Result::Item",
  { itemid => "itemid" },
  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);


__PACKAGE__->belongs_to(
  "tagid",
  "Biblio::Zotero::DB::Schema::Result::Tag",
  { tagid => "tagid" },
  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);


# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-07-02 23:02:38
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Xc3btUyiE4Uuz0xCCZZE1Q


# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;

lib/Biblio/Zotero/DB/Schema/Result/ItemTag.pm  view on Meta::CPAN

=head1 TABLE: C<itemTags>

=head1 ACCESSORS

=head2 itemid

  data_type: 'int'
  is_foreign_key: 1
  is_nullable: 0

=head2 tagid

  data_type: 'int'
  is_foreign_key: 1
  is_nullable: 0

=head1 PRIMARY KEY

=over 4

=item * L</itemid>

=item * L</tagid>

=back

=head1 RELATIONS

=head2 itemid

Type: belongs_to

Related object: L<Biblio::Zotero::DB::Schema::Result::Item>

=head2 tagid

Type: belongs_to

Related object: L<Biblio::Zotero::DB::Schema::Result::Tag>

=head1 AUTHOR

Zakariyya Mughal <zmughal@cpan.org>

=head1 COPYRIGHT AND LICENSE

lib/Biblio/Zotero/DB/Schema/Result/Tag.pm  view on Meta::CPAN

use strict;
use warnings;

use base 'DBIx::Class::Core';


__PACKAGE__->table("tags");


__PACKAGE__->add_columns(
  "tagid",
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
  "name",
  { data_type => "text", is_nullable => 0 },
  "type",
  { data_type => "int", is_nullable => 0 },
  "dateadded",
  {
    data_type     => "timestamp",
    default_value => \"current_timestamp",
    is_nullable   => 0,

lib/Biblio/Zotero/DB/Schema/Result/Tag.pm  view on Meta::CPAN

    default_value => \"current_timestamp",
    is_nullable   => 0,
  },
  "libraryid",
  { data_type => "int", is_nullable => 1 },
  "key",
  { data_type => "text", is_nullable => 0 },
);


__PACKAGE__->set_primary_key("tagid");


__PACKAGE__->add_unique_constraint("libraryid_key_unique", ["libraryid", "key"]);


__PACKAGE__->add_unique_constraint("libraryid_name_type_unique", ["libraryid", "name", "type"]);


__PACKAGE__->has_many(
  "item_tags",
  "Biblio::Zotero::DB::Schema::Result::ItemTag",
  { "foreign.tagid" => "self.tagid" },
  { cascade_copy => 0, cascade_delete => 0 },
);


__PACKAGE__->many_to_many("itemids", "item_tags", "itemid");


# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-07-02 23:02:38
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KZ6mzhv66OnDC6I6Qr/EwQ

lib/Biblio/Zotero/DB/Schema/Result/Tag.pm  view on Meta::CPAN

version 0.004

=head1 NAME

Biblio::Zotero::DB::Schema::Result::Tag

=head1 TABLE: C<tags>

=head1 ACCESSORS

=head2 tagid

  data_type: 'integer'
  is_auto_increment: 1
  is_nullable: 0

=head2 name

  data_type: 'text'
  is_nullable: 0

lib/Biblio/Zotero/DB/Schema/Result/Tag.pm  view on Meta::CPAN


=head2 key

  data_type: 'text'
  is_nullable: 0

=head1 PRIMARY KEY

=over 4

=item * L</tagid>

=back

=head1 UNIQUE CONSTRAINTS

=head2 C<libraryid_key_unique>

=over 4

=item * L</libraryid>



( run in 2.024 seconds using v1.01-cache-2.11-cpan-97f6503c9c8 )