CWIS Developer Documentation
Public Member Functions | Static Public Member Functions | List of all members
ClassificationFactory Class Reference

Factory for producing and manipulating Classification objects. More...

Inheritance diagram for ClassificationFactory:
Inheritance graph
[legend]
Collaboration diagram for ClassificationFactory:
Collaboration graph
[legend]

Public Member Functions

 ClassificationFactory ($FieldId=NULL)
 Class constructor. More...
 
 GetChildIds ($ClassId)
 Get IDs of all children of specified classification. More...
 
 RecalculateAllResourceCounts ()
 Queue tasks to recalculate resource counts for all classifications. More...
 
 FindMatchingRecentlyUsedValues ($SearchString, $NumberOfResults=5, $IdExclusions=array(), $ValueExclusions=array())
 
- 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...
 

Static Public Member Functions

static RecalculateResourceCount ($Id)
 Callback to recalculate the resource count for a single classification by its ID. More...
 

Additional Inherited Members

- Protected Attributes inherited from ItemFactory
 $DB
 

Detailed Description

Factory for producing and manipulating Classification objects.

See also
ItemFactory

Definition at line 14 of file ClassificationFactory.php.

Member Function Documentation

ClassificationFactory::ClassificationFactory (   $FieldId = NULL)

Class constructor.

Parameters
int$FieldIdID of metadata field for classification.

Definition at line 22 of file ClassificationFactory.php.

References ItemFactory\ItemFactory().

ClassificationFactory::FindMatchingRecentlyUsedValues (   $SearchString,
  $NumberOfResults = 5,
  $IdExclusions = array(),
  $ValueExclusions = array() 
)

Definition at line 86 of file ClassificationFactory.php.

ClassificationFactory::GetChildIds (   $ClassId)

Get IDs of all children of specified classification.

Parameters
int$ClassIdID of classification.
Returns
array IDs of all child classifications.

Definition at line 36 of file ClassificationFactory.php.

References ItemFactory\$DB.

ClassificationFactory::RecalculateAllResourceCounts ( )

Queue tasks to recalculate resource counts for all classifications.

Definition at line 64 of file ClassificationFactory.php.

References ItemFactory\GetItemIds().

static ClassificationFactory::RecalculateResourceCount (   $Id)
static

Callback to recalculate the resource count for a single classification by its ID.

Parameters
int$IdID of the classification for which to recalculate the count.

Definition at line 128 of file ClassificationFactory.php.

References Classification\CLASSSTAT_OK.


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