class Builder_Item

Package: Record\Builder

Build an item.

constant IS_PUBLIC
property _recordClass
property _settableProperties
property _elementTexts
property _fileMetadata
setElementTexts(array $elementTexts)

Set the element texts for the item.

  • $elementTexts (array) –
setFileMetadata(array $fileMetadata)

Set the file metadata for the item.

  • $fileMetadata (array) –
setRecordMetadata(array $metadata)

Overrides setRecordMetadata() to allow setting the item type by name instead of ID.

  • $metadata (array) –



Add element texts to a record.


Replace all the element texts for existing element texts.


Add tags to an item (must exist in database).

addFiles(string|Omeka_File_Ingest_AbstractIngest $transferStrategy, string|array $files, $options = Array)

Add files to an item.

<li>’Url|Filesystem’ => string|array If a string is given, this representsthe source identifier of a single file (the URL representing the file, orthe absolute file path, respectively). If an array is given, it assumesthat each entry in the array must be either an array or a string. If itan array, there are several default keys that may be present:<ul><li>’source’ => Any identifier that is appropriate to the transferstrategy in use. For ‘Url’, this should be a valid URL. For ‘Filesystem’,it must be an absolute path to the source file to be transferred.</li><li>’name’ => OPTIONAL The filename to give to the transferredfile. This can be any arbitrary filename and will be listed as theoriginal filename of the file. This will also be used to generate thearchival filename for the file. If none is given, this defaults to usingthe getOriginalFileName() method of the transfer adapter.</li><li>’metadata’ => OPTIONAL This could contain any metadata that needs to beassociated with the file. This should be indexed in the same fashionas for items. See ActsAsElementText::addTextsByArray()</li></ul></li></ul>

  • $transferStrategy (string|Omeka_File_Ingest_AbstractIngest) – This can either be one of the following strings denoting built-in transfer methods: ‘Upload’, ‘Filesystem’, ‘Url’ Or it could be an implemented Omeka_File_Ingest_AbstractIngest class.
  • $files (string|array) –

    This can be a single string, an array of strings, or an array of arrays, depending on the parameters that are needed by the underlying strategy. Expected parameters for the built in strategies are as follows:

    • 'Upload' => null|string If a string is given, it represents the POST parameter name containing the uploaded file(s). If null is given, all files in the POST will be ingested.
    • $options (unknown) –

array Set of File records ingested. May be empty if no files were ingested.

_addIngestValidators(Omeka_File_Ingest_AbstractIngest $ingester)

Add the default validators for ingested files.

The default validators are whitelists for file extensions and MIME types, and those lists can be configured via the admin settings form.

These default validators can be disabled by the ‘disable_default_file_validation’ flag in the settings panel.

Plugins can add/remove/modify validators via the ‘file_ingest_validators’filter.



_beforeBuild(Omeka_Record_AbstractRecord $record)
_afterBuild(Omeka_Record_AbstractRecord $record)

Add tags to the item.