CWIS Developer Documentation

- Home
- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
FileFactory Class Reference

Factory for manipulating File objects. More...

Inheritance diagram for FileFactory:
[legend]
Collaboration diagram for FileFactory:
[legend]

## Public Member Functions
| __construct ($FieldId=NULL)
| Object constructor. More...
| GetFilesForResource ($ResourceOrResourceId, $ReturnObjects=TRUE)
| Retrieve all files (names or objects) for specified resource. More...
| Copy ($FileToCopy)
| Create copy of File and return to caller. More...
Public Member Functions inherited from ItemFactory
| ItemFactory ($ItemClassName, $ItemTableName, $ItemIdFieldName, $ItemNameFieldName=NULL, $OrderOpsAllowed=FALSE, $SqlCondition=NULL)
| Class constructor. More...
| GetItemClassName ()
| Get class name of items manipulated by factory. More...
| GetCurrentEditedItemId ()
| Get ID of currently edited item. More...
| SetCurrentEditedItemId ($NewId)
| Set ID of currently edited item. More...
| ClearCurrentEditedItemId ()
| Clear currently edited item ID. More...
| ClearCurrentEditedItem ()
| Delete currently edited item and clear currently edited item ID. More...
| CleanOutStaleTempItems ($MinutesUntilStale=10080)
| Clear out (call the Delete() method) for any temp items more than specified number of minutes old. More...
| GetLastTempItemId ()
| Retrieve most recent temp item ID for currently-logged-in user. More...
| GetNextItemId ()
| Retrieve next available (non-temp) item ID. More...
| GetHighestItemId ($IgnoreSqlCondition=FALSE)
| Retrieve highest item ID in use. More...
| GetNextTempItemId ()
| Return next available temporary item ID. More...
| GetItemCount ($Condition=NULL, $IncludeTempItems=FALSE)
| Get count of items. More...
| GetItemIds ($Condition=NULL, $IncludeTempItems=FALSE, $SortField=NULL, $SortAscending=TRUE)
| Return array of item IDs. More...
| GetLatestModificationDate ($Condition=NULL)
| Get newest modification date (based on values in "DateLastModified" column in database table). More...
| GetItem ($ItemId)
| Retrieve item by item ID. More...
| ItemExists ($ItemId, $IgnoreSqlCondition=FALSE)
| Check that item exists with specified ID. More...
| GetItemByName ($Name, $IgnoreCase=FALSE)
| Retrieve item by name. More...
| GetItemIdByName ($Name, $IgnoreCase=FALSE)
| Retrieve item ID by name. More...
| GetItemNames ($SqlCondition=NULL)
| Retrieve item names. More...
| GetItems ($SqlCondition=NULL)
| Retrieve items. More...
| 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. More...
| NameIsInUse ($Name, $IgnoreCase=FALSE)
| Check whether item name is currently in use. More...
| SearchForItemNames ($SearchString, $NumberOfResults=100, $IncludeVariants=FALSE, $UseBooleanMode=TRUE, $Offset=0, $IdExclusions=array(), $ValueExclusions=array())
| Retrieve items with names matching search string. More...
| GetCountForItemNames ($SearchString, $IncludeVariants=FALSE, $UseBooleanMode=TRUE, $IdExclusions=array(), $ValueExclusions=array())
| Retrieve count of items with names matching search string. More...
| AddItem ($ItemName, $AdditionalValues=NULL)
| Add new item. More...
| DeleteItem ($ItemId)
| Delete item. More...
| SetOrderOpsCondition ($Condition)
| Set SQL condition (added to WHERE clause) used to select items for ordering operations. More...
| InsertBefore ($TargetItem, $NewItem)
| Insert item into order before specified item. More...
| InsertAfter ($TargetItem, $NewItem)
| Insert item into order after specified item. More...
| Prepend ($Item)
| Add item to beginning of order. More...
| Append ($Item)
| Add item to end of order. More...
| GetItemIdsInOrder ()
| Retrieve list of item IDs in order. More...
| RemoveItemFromOrder ($ItemId)
| Remove item from existing order. More...

## Additional Inherited Members
Protected Attributes inherited from ItemFactory
| $DB

## Detailed Description

Factory for manipulating File objects.

Definition at line 13 of file FileFactory.php.

## Constructor & Destructor Documentation

FileFactory::__construct | ( |  | $FieldId = `NULL` | ) |

Object constructor.

Parameters

  int | $FieldId | Metadata field ID. (OPTIONAL)

Definition at line 21 of file FileFactory.php.

References ItemFactory\ItemFactory().

## Member Function Documentation

FileFactory::Copy | ( |  | $FileToCopy | ) |

Create copy of File and return to caller.

Parameters

  object | $FileToCopy | File object for file to copy.

Returns
  object New File object.

Definition at line 84 of file FileFactory.php.

Referenced by Resource\Set().

Here is the caller graph for this function:

FileFactory::GetFilesForResource | ( |  | $ResourceOrResourceId,
|  |  | $ReturnObjects = `TRUE`
| ) |  |

Retrieve all files (names or objects) for specified resource.

Parameters

  int | object | $ResourceOrResourceId | Resource object or ID.
  bool | $ReturnObjects | Whether to return File objects instead of names.

Returns
  array Array of name strings or File objects, with file IDs for index. (OPTIONAL, defaults to TRUE)

Definition at line 38 of file FileFactory.php.

Referenced by Resource\Get().

Here is the caller graph for this function:

The documentation for this class was generated from the following file:

- objects/FileFactory.php