NAME

BSE::TB::TagOwner - mixin for objects with tags


SYNOPSIS

  my $article = ...;
  $article->set_tags([ qw/tag1 tag2/ ], \$error);
  $article->remove_tags;
  my @tags = $article->tag_objects;
  my @tag_names = $article->tags;
  my @tag_ids = $article->tag_ids;
  if ($article->has_tags([ "tag1", "tag2" ])) {
    ...
  }


DESCRIPTION

This class is a mix-in that implements tags for the mixed-into object.


METHODS PROVIDED

set_tags(\@tags, \$error)

Set the specified tags on the object, replacing all existing tags.

remove_tags

Remove all tags from the object.

tag_objects

Return all existing tags on the object as tag objects.

tags

Returns all existing tags on the object as tag names.

tag_ids

Returns all existing tags on the object as tag ids.

tag_members

Return all tag membership links for the object.

has_tags(\@tags)

Check that all of the specified tags are on the object.

tag_by_name

Return the tag (if any) by name for this object type.

Returns an empty list if no such tag is found.

collection_with_tags()

This is a wrapper for collection_with_tags() in the BSE::TB::TagOwners manpage that passes $self as the self parameter in \%opts.


REQUIRED METHODS

These need to be implemented by the class that wants tags.

tag_owner_type

Return a short constant string identifying owner class of the tags.

id

The numeric id of the specific owner object of the tags.

tableClass

The name of the class for collections of the tag owner.


AUTHOR

Tony Cook <tony@develop-help.com>