Element

Package: Record

class Element

extends Omeka_Record_AbstractRecord

implements Zend_Acl_Resource_Interface

A metadata element within an element set or item type.

property Element::$element_set_id

int

ID of the ElementSet this Element belongs to.

property Element::$order

int

This Element’s order within the parent ElementSet.

property Element::$name

string

A human-readable name

property Element::$description

string

A human-readable description

property Element::$comment

string

A user-generated comment

Element::setElementSet($elementSetName)

Set the parent ElementSet by name.

Parameters:
  • $elementSetName (string) –

Element::getElementSet()

Return the parent ElementSet object for this element.

Returns:

ElementSet|null

Element::setOrder($order)

Set the order of the element within its element set.

Parameters:
  • $order (int) –

Element::setName($name)

Set the Element’s name.

Parameters:
  • $name (string) –

Element::setDescription($description)

Set the Element’s description.

Parameters:
  • $description (string) –

Element::setComment($comment)

Set the Element’s comment.

Parameters:
  • $comment (string) –

Element::setArray($data)

Set the data for the Element in bulk.

  • name

  • description

  • comment

  • order

  • element_set_id

  • element_set

Parameters:
  • $data (array|string) – If string, the name of the element. Otherwise, array of metadata for the element. The array may contain the following keys:

Element::_validate()

Validate the element prior to being saved.

Checks the following criteria:

  • Name is not empty.

  • Name does not already exist within the given element set.

Element::_delete()

Delete associated records when deleting the Element.

Cascade delete to all element texts and item type assignments associated with the element.

Element::_getElementSetId($elementSetName)

Get an element set ID from a name.

Parameters:
  • $elementSetName

Returns:

int

Element::_nameIsInSet($elementName, $elementSetId)

Calculate whether the element’s name already belongs to the current set.

Parameters:
  • $elementName

  • $elementSetId

Returns:

bool

Element::getResourceId()

Identify Element records as relating to the Elements ACL resource.

Required by Zend_Acl_Resource_Interface.

Returns:

string