Mixin_Tag

class Mixin_Tag

Package: Record\Mixin

property _tagTable
property _joinTable
property _type
__construct(Omeka_Record_AbstractRecord $record)
Parameters:
beforeDelete()

Fires whenever deleting a record that is taggable This will actually delete all the references to a specific tag for a specific record

Returns:void
afterSave($args)

Add tags to this record’s search text.

Parameters:
  • $args (unknown) –
deleteTaggings()
getTaggings()

Retrieve all the Taggings objects that represent between a specific tag and the current record Called by whatever record has enabled this module

Returns:array of Taggings
getTags($order = Array)

Get all the Tag records associated with this record

Parameters:
  • $order (unknown) –
Returns:

array of Tag

deleteTags(string|array $tags, string $delimiter)

Delete a tag from the record

Parameters:
  • $tags (string|array) – The tag name or array of tag names to delete from the record
  • $delimiter (string) – The delimiter of the tags. Not applicable if $tags is an array
Returns:

bool Returns whether a tag in $tags was deleted. Returns false if $tags is empty. Returns true if at least one tag in $tags is deleted.

hasTag($tag)

If the $tag were a string and the keys of Tags were just the names of the tags, this would be: in_array(array_keys($this->Tags))

Parameters:
  • $tag (unknown) –
Returns:

boolean

_getTagsFromString(string $string, $delimiter)

Converts a delimited string of tags into an array of tag strings

Parameters:
  • $string (string) – A delimited string of tags
  • $delimiter (unknown) –
Returns:

array An array of tag strings

addTags(array|string $tags, $delimiter)

Add tags for the record

Parameters:
  • $tags (array|string) – Either an array of tags or a delimited string
  • $delimiter (unknown) –
Returns:

void

diffTagString($string, $tags, $delimiter)

Calculate the difference between a tag string and a set of tags

Parameters:
  • $string (unknown) –
  • $tags (unknown) –
  • $delimiter (unknown) –
Returns:

array Keys(‘removed’,’added’)

applyTagString(string $string, $delimiter)

This will add tags that are in the tag string and remove those that are no longer in the tag string

Parameters:
  • $string (string) – A string of tags delimited by $delimiter
  • $delimiter (unknown) –
Returns:

void