CWIS Developer Documentation

- Home
- Main Page
- Classes
- Files

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

Public Member Functions | List of all members
FolderFactory Class Reference

Factory object for Folder class, used to retrieve and manage Folders and groups of Folders. More...

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

## Public Member Functions
| FolderFactory ($OwnerId=NULL)
| Constructor for FolderFactory. More...
| CreateFolder ($ItemType, $FolderName=NULL, $OwnerId=NULL)
| Create new folder that will contain only one type of item. More...
| CreateMixedFolder ($FolderName=NULL, $OwnerId=NULL)
| Create new folder that can contain multiple types of items. More...
| GetFolderCount ()
| Get total number of folders currently existing. More...
| GetFolderByNormalizedName ($NormalizedName, $OwnerId=NULL)
| GetFoldersContainingItem ($Item, $ItemType, $OwnerId=NULL, $SharedFoldersOnly=FALSE)
| Retrieve folders containing specified item. More...
| GetFolders ($ItemType=NULL, $OwnerId=NULL, $Name=NULL, $Offset=0, $Count=NULL)
| Retrieve folders with specified name, owner, or default content type. 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 object for Folder class, used to retrieve and manage Folders and groups of Folders.

Definition at line 14 of file FolderFactory.php.

## Member Function Documentation

FolderFactory::CreateFolder | ( |  | $ItemType,
|  |  | $FolderName = `NULL`,
|  |  | $OwnerId = `NULL`
| ) |  |

Create new folder that will contain only one type of item.

Parameters

  mixed | $ItemType | Type of item that folder will contain.
  string | $FolderName | String containing name of folder. (OPTIONAL)
  int | $OwnerId | Numerical ID of folder owner. (OPTIONAL)

Returns
  New folder (object).

Definition at line 44 of file FolderFactory.php.

References Folder\MIXEDCONTENT.

Referenced by CreateMixedFolder().

Here is the caller graph for this function:

FolderFactory::CreateMixedFolder | ( |  | $FolderName = `NULL`,
|  |  | $OwnerId = `NULL`
| ) |  |

Create new folder that can contain multiple types of items.

(This is a separate operation because mixed item types incurs execution overhead.)

Parameters

  string | $FolderName | String containing name of folder. (OPTIONAL)
  int | $OwnerId | Numerical ID of folder owner. (OPTIONAL)

Returns
  New folder (object).

Definition at line 74 of file FolderFactory.php.

References CreateFolder(), and Folder\MIXEDCONTENT.

FolderFactory::FolderFactory | ( |  | $OwnerId = `NULL` | ) |

Constructor for FolderFactory.

Parameters

  int | $OwnerId | ID of owner of folders to be manipulated by factory. If specified then all operations pertain only to folders with the specified owner. (OPTIONAL)

Definition at line 24 of file FolderFactory.php.

References ItemFactory\ItemFactory(), and ItemFactory\SetOrderOpsCondition().

FolderFactory::GetFolderByNormalizedName | ( |  | $NormalizedName,
|  |  | $OwnerId = `NULL`
| ) |  |

Definition at line 99 of file FolderFactory.php.

FolderFactory::GetFolderCount | ( |  | ) |

Get total number of folders currently existing.

Returns
  Number of folders.

Definition at line 84 of file FolderFactory.php.

References ItemFactory\GetItemCount().

FolderFactory::GetFolders | ( |  | $ItemType = `NULL`,
|  |  | $OwnerId = `NULL`,
|  |  | $Name = `NULL`,
|  |  | $Offset = `0`,
|  |  | $Count = `NULL`
| ) |  |

Retrieve folders with specified name, owner, or default content type.

If no parameters are specified, all existing folders are returned. If no owner ID parameter is supplied and an owner ID was specified for FolderFactory::FolderFactory(), then that owner ID is used.

Parameters

  mixed | $ItemType | String containing type of item to search for as default content type of folder. To search for only mixed-content-type folders specify Folder::MIXEDCONTENT. (OPTIONAL, defaults to NULL)
  int | $OwnerId | Numerical ID of folder owner. (OPTIONAL, defaults to NULL)
  string | $Name | String containing target folder name. (OPTIONAL, defaults to NULL)
  int | $Offset | Zero-based offset into list of folders. (OPTIONAL)
  int | $Count | Number of folders to retrieve beginning at specified offset. (OPTIONAL)

Returns
  Array of Folder objects that match specified parameters.

Definition at line 187 of file FolderFactory.php.

References ItemFactory\GetItemIds(), and Folder\MIXEDCONTENT.

FolderFactory::GetFoldersContainingItem | ( |  | $Item,
|  |  | $ItemType,
|  |  | $OwnerId = `NULL`,
|  |  | $SharedFoldersOnly = `FALSE`
| ) |  |

Retrieve folders containing specified item.

Parameters

  Item | $Item | object (must have Id() method) or item ID.
  int | string | $ItemType | the item type
  int | $OwnerId | optional owner ID to restrict folders to
  bool | $SharedFoldersOnly | Whether to only return shared folders.

Returns
  Array of Folder objects that contain specified item.

Definition at line 133 of file FolderFactory.php.

References Folder\MIXEDCONTENT.

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

- objects/FolderFactory.php