Skip to content

Commit

Permalink
Renames InsertItemHelper to ItemBuilder and moves to models/ director…
Browse files Browse the repository at this point in the history
…y, which fits better with both the pattern and usage of this class.
  • Loading branch information
kriskelly committed May 4, 2009
1 parent 9ed16bc commit f9c607e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion application/libraries/Omeka/File/Ingest/Abstract.php
Expand Up @@ -25,7 +25,7 @@
* $ingest = Omeka_File_Ingest_Abstract::factory('Url', $item);
* $fileRecords = $ingest->ingest('http://www.example.com');
*
* @see InsertItemHelper::addFiles()
* @see ItemBuilder::addFiles()
* @package Omeka
* @copyright Center for History and New Media, 2009
**/
Expand Down
12 changes: 6 additions & 6 deletions application/libraries/globals.php
Expand Up @@ -322,7 +322,7 @@ function is_admin_theme()
/**
* Insert a new item into the Omeka database.
*
* @uses InsertItemHelper For more information on arguments and usage.
* @uses ItemBuilder For more information on arguments and usage.
* @param array $metadata Optional
* @param array $elementTexts Optional
* @param array $fileMetadata Optional
Expand All @@ -331,15 +331,15 @@ function is_admin_theme()
function insert_item($metadata = array(), $elementTexts = array(), $fileMetadata = array())
{
// Passing null means this will create a new item.
$helper = new InsertItemHelper(null, $metadata, $elementTexts, $fileMetadata);
$helper = new ItemBuilder(null, $metadata, $elementTexts, $fileMetadata);
$helper->run();
return $helper->getItem();
}

/**
* Add files to an item.
*
* @uses InsertItemHelper::addFiles() See for information on arguments and notes
* @uses ItemBuilder::addFiles() See for information on arguments and notes
* on usage.
* @param Item|integer $item
* @param string|Omeka_File_Ingest_Abstract $transferStrategy
Expand All @@ -349,13 +349,13 @@ function insert_item($metadata = array(), $elementTexts = array(), $fileMetadata
**/
function insert_files_for_item($item, $transferStrategy, $files, $options = array())
{
$helper = new InsertItemHelper($item);
$helper = new ItemBuilder($item);
return $helper->addFiles($transferStrategy, $files, $options);
}

/**
* @see insert_item()
* @uses InsertItemHelper
* @uses ItemBuilder
* @param Item|int $item Either an Item object or the ID for the item.
* @param array $metadata Set of options that can be passed to the item.
* @param array $elementTexts
Expand All @@ -364,7 +364,7 @@ function insert_files_for_item($item, $transferStrategy, $files, $options = arra
**/
function update_item($item, $metadata = array(), $elementTexts = array(), $fileMetadata = array())
{
$helper = new InsertItemHelper($item, $metadata, $elementTexts, $fileMetadata);
$helper = new ItemBuilder($item, $metadata, $elementTexts, $fileMetadata);
$helper->run();
return $helper->getItem();
}
Expand Down
Expand Up @@ -10,7 +10,7 @@
* @package Omeka
* @copyright Center for History and New Media, 2009
**/
class InsertItemHelper
class ItemBuilder
{
protected $_item;
protected $_metadata = array();
Expand Down Expand Up @@ -75,7 +75,7 @@ class InsertItemHelper
* <li>'files' (array or string) Represents information indicating the file
* to ingest. Corresponds to the $files argument for addFiles().</li>
* </ul>
* @see InsertItemHelper::addFiles()
* @see ItemBuilder::addFiles()
* @see ActsAsElementText::addElementTextsByArray()
**/
public function __construct($item = null, $itemMetadata = array(), $elementTexts = array(), $fileMetadata = array())
Expand Down

0 comments on commit f9c607e

Please sign in to comment.