Class ItemBuilder

Description
  • copyright: Center for History and New Media, 2009
  • usedby: update_item()
  • usedby: insert_item() - For more information on arguments and usage.

Located in /application/models/ItemBuilder.php (line 13)

Omeka_Record_Builder
   |
   --ItemBuilder
Variable Summary
Method Summary
 ItemBuilder __construct ([ $metadata = array()], [ $elementTexts = array()], [ $fileMetadata = array()], [ $record = null])
 array addFiles (string|Omeka_File_Ingest_Abstract $transferStrategy, string|array $files, [ $options = array()])
 void _afterBuild ()
 void _beforeBuild ()
 void _parseMetadataOptions ( $itemMetadata)
Variables
mixed $_recordClass = 'Item' (line 15)
  • access: protected

Redefinition of:
Omeka_Record_Builder::$_recordClass
mixed $_settableProperties = array('item_type_id', 'collection_id', 'public', 'featured') (line 16)
  • access: protected

Redefinition of:
Omeka_Record_Builder::$_settableProperties

Inherited Variables

Inherited from Omeka_Record_Builder

Omeka_Record_Builder::$_metadataOptions
Omeka_Record_Builder::$_record
Methods
Constructor __construct (line 21)
  • access: public
ItemBuilder __construct ([ $metadata = array()], [ $elementTexts = array()], [ $fileMetadata = array()], [ $record = null])
  • $metadata
  • $elementTexts
  • $fileMetadata
  • $record

Redefinition of:
Omeka_Record_Builder::__construct()
addFiles (line 128)

Add files to an item.

Add files to an item.

  • return: Set of File records ingested. May be empty if no files were ingested.
  • access: public
  • usedby: insert_files_for_item() - See for information on arguments and notes on usage.
array addFiles (string|Omeka_File_Ingest_Abstract $transferStrategy, string|array $files, [ $options = array()])
  • string|Omeka_File_Ingest_Abstract $transferStrategy: 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_Abstract class.
  • string|array $files: 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.
    • 'Url|Filesystem' => string|array If a string is given, this represents the source identifier of a single file (the URL representing the file, or the absolute file path, respectively). If an array is given, it assumes that each entry in the array must be either an array or a string. If it an array, there are several default keys that may be present:
      • 'source' => Any identifier that is appropriate to the transfer strategy 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.
      • 'name' => OPTIONAL The filename to give to the transferred file. This can be any arbitrary filename and will be listed as the original filename of the file. This will also be used to generate the archival filename for the file. If none is given, this defaults to using the getOriginalFileName() method of the transfer adapter.
      • 'metadata' => OPTIONAL This could contain any metadata that needs to be associated with the file. This should be indexed in the same fashion as for items. See ActsAsElementText::addTextsByArray()
  • array $options: OPTIONAL May contain the following flags where appropriate:
    • 'ignore_invalid_files' => Do not throw exceptions when attempting to ingest invalid files. Instead, skip to the next file in the list and continue processing. False by default. (all except Upload).
    • 'ignoreNoFile' => Ignore errors resulting from POSTs that do not contain uploaded files as expected (only for Upload).
_addIngestValidators (line 167)

Add the default validators for ingested files.

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.

  • access: protected
void _addIngestValidators (Omeka_File_Ingest_Abstract $ingester)
_afterBuild (line 210)

Add tags to the item.

Add tags to the item.

  • access: protected
void _afterBuild ()

Redefinition of:
Omeka_Record_Builder::_afterBuild()
All necessary tasks that take place after the record has been inserted into the database.
_beforeBuild (line 183)
  • access: protected
void _beforeBuild ()

Redefinition of:
Omeka_Record_Builder::_beforeBuild()
All necessary tasks to take place before the record has been inserted.
_parseMetadataOptions (line 222)

Determine the item_type_id value from 'item_type_name', if given.

Determine the item_type_id value from 'item_type_name', if given.

  • access: protected
void _parseMetadataOptions ( $itemMetadata)
  • array $itemMetadata

Redefinition of:
Omeka_Record_Builder::_parseMetadataOptions()
May be overridden by subclasses to clean up the input instructions.

Inherited Methods

Inherited From Omeka_Record_Builder

 Omeka_Record_Builder::__construct()
 Omeka_Record_Builder::build()
 Omeka_Record_Builder::_afterBuild()
 Omeka_Record_Builder::_beforeBuild()
 Omeka_Record_Builder::_parseMetadataOptions()

Documentation generated on Thu, 15 Oct 2009 15:38:23 -0400 by phpDocumentor 1.4.2