Item

Package: Record

class Item

extends Omeka_Record_AbstractRecord

implements Zend_Acl_Resource_Interface

An item and its metadata.

property Item::$item_type_id

int

The ID for this Item’s ItemType, if any.

property Item::$collection_id

int

The ID for this Item’s Collection, if any.

property Item::$featured

int

Whether this Item is featured.

property Item::$public

int

Whether this Item is publicly accessible.

property Item::$added

string

The date this Item was added.

property Item::$modified

string

The date this Item was last modified.

property Item::$owner_id

int

ID of the User who created this Item.

protected array

Records related to an Item.

Item::_initializeMixins()

Initialize the mixins.

Item::getCollection()

Get this Item’s Collection, if any.

Returns:

Collection|null

Item::getItemType()

Get the ItemType record associated with this Item.

Returns:

ItemType|null

Item::getFiles()

Get the set of File records associated with this Item.

Returns:

array

Item::getFile($index = 0)

Get a single File associated with this Item, by index.

The default is to get the first file.

Parameters:
  • $index (int) –

Returns:

File

Item::getItemTypeElements()

Get a set of Elements associated with this Item’s ItemType.

Each one of the Element records that is retrieved should contain all the element text values associated with it.

Returns:

array Element records that are associated with the item type of the item. This array will be empty if the item does not have an associated type.

Item::getProperty($property)

Get a property for display.

Parameters:
  • $property (string) –

Returns:

mixed

Item::beforeSave($args)

Before-save hook.

Parameters:
  • $args (array) –

Item::afterSave($args)

After-save hook.

Parameters:
  • $args (array) –

Item::_delete()

All of the custom code for deleting an item.

Item::_deleteFiles($fileIds = array())

Delete files associated with the item.

If the IDs of specific files are passed in, this will delete only those files (e.g. form submission). Otherwise, it will delete all files associated with the item.

Parameters:
  • $fileIds (array) – Optional

Item::_uploadFiles()

Iterate through the $_FILES array for files that have been uploaded to Omeka and attach each of those files to this Item.

Item::saveFiles()

Save all the files that have been associated with this item.

Item::filterPostData($post)

Filter post data from form submissions.

Parameters:
  • $post

Returns:

array Clean post data

Item::fileCount()

Get the number of files assigned to this item.

Returns:

int

Item::previous()

Get the previous Item in the database.

Returns:

Item|false

Item::next()

Get the next Item in the database.

Returns:

Item|false

Item::hasThumbnail()

Determine whether or not the Item has a File with a thumbnail image (or any derivative image).

Returns:

bool

Item::getCitation()

Return a valid citation for this item.

Generally follows Chicago Manual of Style note format for webpages. Implementers can use the item_citation filter to return a customized citation.

Returns:

string

Item::addFile(File $file)

Associate an unsaved (new) File record with this Item.

These File records will not be persisted in the database until the item is saved or saveFiles() is invoked.

Parameters:
Item::getResourceId()

Identify Item records as relating to the Items ACL resource.

Required by Zend_Acl_Resource_Interface.

Returns:

string

Item::_validate()

Validate this item.