CWIS Developer Documentation
|
Common factory class for item manipulation. More...
Public Member Functions | |
ItemFactory ($ItemClassName, $ItemTableName, $ItemIdFieldName, $ItemNameFieldName=NULL, $FieldId=NULL, $OrderOpsAllowed=FALSE) | |
Status () | |
GetCurrentEditedItemId () | |
SetCurrentEditedItemId ($NewId) | |
ClearCurrentEditedItemId () | |
ClearCurrentEditedItem () | |
CleanOutStaleTempItems ($MinutesUntilStale=10080) | |
Clear out (call the Delete() method) for any temp items more than specified number of minutes old. | |
GetLastTempItemId () | |
GetNextItemId () | |
GetHighestItemId ($Condition=NULL, $IncludeTempItems=FALSE) | |
GetNextTempItemId () | |
GetItemCount ($Condition=NULL, $IncludeTempItems=FALSE) | |
GetItemIds ($Condition=NULL, $IncludeTempItems=FALSE) | |
GetLatestModificationDate ($Condition=NULL) | |
GetItem ($ItemId) | |
ItemExists ($ItemId) | |
Check that item exists with specified ID. | |
GetItemByName ($Name, $IgnoreCase=FALSE) | |
GetItemNames ($SqlCondition=NULL) | |
Retrieve item names. | |
GetItems ($SqlCondition=NULL) | |
Retrieve items. | |
GetItemsAsOptionList ($OptionListName, $SelectedItemId=NULL, $SqlCondition=NULL, $DisplaySize=1, $SubmitOnChange=FALSE) | |
Retrieve items of specified type as HTML option list with item names as labels and item IDs as value attributes. | |
NameIsInUse ($Name, $IgnoreCase=FALSE) | |
Check whether item name is currently in use. | |
SearchForItemNames ($SearchString, $NumberOfResults=100, $IncludeVariants=FALSE, $UseBooleanMode=TRUE, $Offset=0) | |
GetCountForItemNames ($SearchString, $IncludeVariants=FALSE, $UseBooleanMode=TRUE) | |
AddItems ($ItemNames, $Qualifier=NULL) | |
add items with specified names | |
AddItem ($ItemName, $AdditionalValues=NULL) | |
Add new item. | |
DeleteItem ($ItemId) | |
Delete item. | |
SetOrderOpsCondition ($Condition) | |
InsertBefore ($SourceItemOrItemId, $TargetItemOrItemId) | |
InsertAfter ($SourceItemOrItemId, $TargetItemOrItemId) | |
Prepend ($ItemOrItemId) | |
Append ($ItemOrItemId) | |
GetItemIdsInOrder ($AddStrayItemsToOrder=TRUE) | |
RemoveItemFromOrder ($ItemId) | |
Protected Attributes | |
$DB | |
$FieldId | |
Common factory class for item manipulation.
Not intended to be used directly, but rather as a parent for factory classes for specific item types. For a derived class to use the temp methods the item record in the database must include "DateLastModified" and "LastModifiedById" fields, and the item object must include a "Delete()" method.
Definition at line 18 of file ItemFactory.php.
ItemFactory::AddItem | ( | $ItemName, | |
$AdditionalValues = NULL |
|||
) |
Add new item.
ItemName | Value to store in name field for new item. |
AdditionalValues | Associative array of additional values to set in the new item, with DB field names for the array index and values to set them to for the array values. (OPTIONAL) |
Definition at line 733 of file ItemFactory.php.
ItemFactory::AddItems | ( | $ItemNames, | |
$Qualifier = NULL |
|||
) |
add items with specified names
ItemNames | Array of item names. Leading or trailing whitespace is automatically trimmed off of the names. |
Qualifier | Qualifier object to associate with items being added. |
Definition at line 699 of file ItemFactory.php.
References GetItemByName().
ItemFactory::Append | ( | $ItemOrItemId | ) |
Definition at line 828 of file ItemFactory.php.
ItemFactory::CleanOutStaleTempItems | ( | $MinutesUntilStale = 10080 | ) |
Clear out (call the Delete() method) for any temp items more than specified number of minutes old.
MinutesUntilStale | Number of minutes before items are considered stale. (OPTIONAL - defaults to 7 days) |
Definition at line 146 of file ItemFactory.php.
ItemFactory::ClearCurrentEditedItem | ( | ) |
Definition at line 124 of file ItemFactory.php.
References ClearCurrentEditedItemId(), and GetCurrentEditedItemId().
ItemFactory::ClearCurrentEditedItemId | ( | ) |
Definition at line 99 of file ItemFactory.php.
Referenced by ClearCurrentEditedItem().
ItemFactory::DeleteItem | ( | $ItemId | ) |
ItemFactory::GetCountForItemNames | ( | $SearchString, | |
$IncludeVariants = FALSE , |
|||
$UseBooleanMode = TRUE |
|||
) |
Definition at line 623 of file ItemFactory.php.
References $DB.
ItemFactory::GetCurrentEditedItemId | ( | ) |
Definition at line 55 of file ItemFactory.php.
References GetLastTempItemId().
Referenced by ClearCurrentEditedItem().
ItemFactory::GetHighestItemId | ( | $Condition = NULL , |
|
$IncludeTempItems = FALSE |
|||
) |
Definition at line 205 of file ItemFactory.php.
Referenced by MetadataSchema\GetHighestFieldId(), and GetNextItemId().
ItemFactory::GetItem | ( | $ItemId | ) |
Definition at line 335 of file ItemFactory.php.
Referenced by GetItemByName(), GetItems(), OAIServer\ProcessGetRecord(), and OAIServer\ProcessListRecords().
ItemFactory::GetItemByName | ( | $Name, | |
$IgnoreCase = FALSE |
|||
) |
Definition at line 353 of file ItemFactory.php.
References GetItem().
Referenced by AddItems(), and QualifierFactory\GetQualifierByName().
ItemFactory::GetItemCount | ( | $Condition = NULL , |
|
$IncludeTempItems = FALSE |
|||
) |
Definition at line 249 of file ItemFactory.php.
Referenced by FolderFactory\GetFolderCount(), and QualifierFactory\QualifierCount().
ItemFactory::GetItemIds | ( | $Condition = NULL , |
|
$IncludeTempItems = FALSE |
|||
) |
Definition at line 299 of file ItemFactory.php.
Referenced by FolderFactory\GetFolders().
ItemFactory::GetItemIdsInOrder | ( | $AddStrayItemsToOrder = TRUE | ) |
Definition at line 843 of file ItemFactory.php.
ItemFactory::GetItemNames | ( | $SqlCondition = NULL | ) |
Retrieve item names.
SqlCondition | SQL condition (w/o "WHERE") for name retrieval. (OPTIONAL) |
Definition at line 396 of file ItemFactory.php.
Referenced by GetItems(), GetItemsAsOptionList(), and QualifierFactory\QualifierList().
ItemFactory::GetItems | ( | $SqlCondition = NULL | ) |
Retrieve items.
SqlCondition | SQL condition (w/o "WHERE") for name retrieval. (OPTIONAL) |
Definition at line 434 of file ItemFactory.php.
References $Items, GetItem(), and GetItemNames().
Referenced by OAIServer\ProcessListRecords().
ItemFactory::GetItemsAsOptionList | ( | $OptionListName, | |
$SelectedItemId = NULL , |
|||
$SqlCondition = NULL , |
|||
$DisplaySize = 1 , |
|||
$SubmitOnChange = FALSE |
|||
) |
Retrieve items of specified type as HTML option list with item names as labels and item IDs as value attributes.
The first element on the list will have a label of "–" and an ID of -1 to indicate no item selected.
OptionListName | Value of option list "name" attribute. |
SelectedItemId | ID of currently-selected item or array of IDs of currently-selected items. (OPTIONAL) |
SqlCondition | SQL condition (w/o "WHERE") for item retrieval. (OPTIONAL, defaults to NULL) |
DisplaySize | Display length of option list. (OPTIONAL, defaults to 1) |
SubmitOnChange | Whether to submit form when option list changes. (OPTIONAL, defaults to FALSE) |
Definition at line 459 of file ItemFactory.php.
References GetItemNames().
ItemFactory::GetLastTempItemId | ( | ) |
Definition at line 169 of file ItemFactory.php.
Referenced by GetCurrentEditedItemId().
ItemFactory::GetLatestModificationDate | ( | $Condition = NULL | ) |
Definition at line 325 of file ItemFactory.php.
ItemFactory::GetNextItemId | ( | ) |
Definition at line 185 of file ItemFactory.php.
References GetHighestItemId().
ItemFactory::GetNextTempItemId | ( | ) |
Definition at line 230 of file ItemFactory.php.
ItemFactory::InsertAfter | ( | $SourceItemOrItemId, | |
$TargetItemOrItemId | |||
) |
Definition at line 798 of file ItemFactory.php.
ItemFactory::InsertBefore | ( | $SourceItemOrItemId, | |
$TargetItemOrItemId | |||
) |
Definition at line 783 of file ItemFactory.php.
ItemFactory::ItemExists | ( | $ItemId | ) |
Check that item exists with specified ID.
ItemId | ID of item. |
Definition at line 344 of file ItemFactory.php.
ItemFactory::ItemFactory | ( | $ItemClassName, | |
$ItemTableName, | |||
$ItemIdFieldName, | |||
$ItemNameFieldName = NULL , |
|||
$FieldId = NULL , |
|||
$OrderOpsAllowed = FALSE |
|||
) |
Definition at line 23 of file ItemFactory.php.
References $FieldId, and SetOrderOpsCondition().
Referenced by SavedSearchFactory\__construct(), ClassificationFactory\ClassificationFactory(), ControlledNameFactory\ControlledNameFactory(), FileFactory\FileFactory(), FolderFactory\FolderFactory(), MessageFactory\MessageFactory(), MetadataSchema\MetadataSchema(), PrivilegeFactory\PrivilegeFactory(), QualifierFactory\QualifierFactory(), and ResourceFactory\ResourceFactory().
ItemFactory::NameIsInUse | ( | $Name, | |
$IgnoreCase = FALSE |
|||
) |
Check whether item name is currently in use.
Name | Name to check. |
IgnoreCase | If TRUE, ignore case when checking. (Defaults to FALSE) |
Definition at line 507 of file ItemFactory.php.
Referenced by MetadataSchema\FieldExists(), and QualifierFactory\QualifierNameIsInUse().
ItemFactory::Prepend | ( | $ItemOrItemId | ) |
Definition at line 813 of file ItemFactory.php.
ItemFactory::RemoveItemFromOrder | ( | $ItemId | ) |
Definition at line 858 of file ItemFactory.php.
ItemFactory::SearchForItemNames | ( | $SearchString, | |
$NumberOfResults = 100 , |
|||
$IncludeVariants = FALSE , |
|||
$UseBooleanMode = TRUE , |
|||
$Offset = 0 |
|||
) |
Definition at line 520 of file ItemFactory.php.
References $DB.
ItemFactory::SetCurrentEditedItemId | ( | $NewId | ) |
Definition at line 79 of file ItemFactory.php.
ItemFactory::SetOrderOpsCondition | ( | $Condition | ) |
Definition at line 774 of file ItemFactory.php.
Referenced by FolderFactory\FolderFactory(), and ItemFactory().
ItemFactory::Status | ( | ) |
Definition at line 52 of file ItemFactory.php.
|
protected |
Definition at line 875 of file ItemFactory.php.
Referenced by GetCountForItemNames(), MetadataSchema\GetFieldNames(), SearchForItemNames(), and ResourceFactory\UpdateResourceCountCallback().
|
protected |
Definition at line 876 of file ItemFactory.php.
Referenced by ClassificationFactory\ClassificationFactory(), ControlledNameFactory\ControlledNameFactory(), MetadataSchema\DropField(), MetadataSchema\FieldToStdNameMapping(), FileFactory\FileFactory(), MetadataSchema\GetField(), MetadataSchema\GetFieldByLabel(), MetadataSchema\GetFieldByName(), MetadataSchema\GetFieldsAsOptionList(), ResourceFactory\GetMatchingResources(), MetadataSchema\GetOwnedFields(), ResourceFactory\GetResourceCount(), ItemFactory(), and MetadataSchema\StdNameToFieldMapping().