CWIS Developer Documentation
Public Member Functions | Static Public Member Functions | List of all members
SPTRecommender Class Reference
Inheritance diagram for SPTRecommender:
Inheritance graph
[legend]
Collaboration diagram for SPTRecommender:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 SPTRecommender object constructor. More...
 
 GetFieldValue ($ItemId, $FieldName)
 Get value for a given field. More...
 
 QueueUpdateForItem ($ItemOrItemId, $TaskPriority=NULL)
 Queue a background update for a specified item. More...
 
- Public Member Functions inherited from Recommender
 __construct (&$DB, $ItemTableName, $RatingTableName, $ItemIdFieldName, $UserIdFieldName, $RatingFieldName, $ContentFields)
 Object constructor. More...
 
 DebugLevel ($Setting)
 Set level for debugging output. More...
 
 Recommend ($UserId, $StartingResult=0, $NumberOfResults=10)
 Recommend items for specified user. More...
 
 AddResultFilterFunction ($FunctionName)
 Add function to be called to filter returned recommendation list. More...
 
 NumberOfResults ()
 Get number of recommendations generated. More...
 
 SearchTime ()
 Get time it took to generate the most recent recommendation. More...
 
 GetSourceList ($UserId, $RecommendedItemId)
 Return list of items used to generate recommendation of specified item. More...
 
 FindSimilarItems ($ItemId, $FieldList=NULL)
 Dynamically generate and return list of items similar to specified item. More...
 
 RecommendFieldValues ($ItemId, $FieldList=NULL)
 Dynamically generate and return list of recommended field values for item. More...
 
 UpdateForItems ($StartingItemId, $NumberOfItems)
 Update recommender data for range of items. More...
 
 UpdateForItem ($ItemId, $FullPass=FALSE)
 Update recommender data for specified item. More...
 
 DropItem ($ItemId)
 Drop item from stored recommender data. More...
 
 PruneCorrelations ()
 Prune any stored correlation values that are below-average. More...
 
 GetItemIds ()
 Retrieve all item IDs. More...
 

Static Public Member Functions

static RunUpdateForItem ($SourceItemId, $StartingIndex)
 Perform recommender db updates for a specified item (usually in the background) More...
 
static SetUpdatePriority ($NewPriority)
 Set the default priority for background tasks. More...
 
- Static Public Member Functions inherited from Recommender
static ClearCaches ()
 Clear internal caches of item and correlation data. More...
 

Additional Inherited Members

- Public Attributes inherited from Recommender
const CONTENTFIELDTYPE_TEXT = 1
 
const CONTENTFIELDTYPE_NUMERIC = 2
 
const CONTENTFIELDTYPE_CONTROLLEDNAME = 3
 
const CONTENTFIELDTYPE_DATE = 4
 
const CONTENTFIELDTYPE_DATERAMGE = 5
 
- Protected Member Functions inherited from Recommender
 LoadItemIds ()
 Load internal item ID cache (if not already loaded). More...
 
 GetFieldData ($ItemId, $FieldName)
 Get data for field. More...
 
 CalculateContentCorrelation ($ItemIdA, $ItemIdB, $FieldList=NULL)
 Calculate content correlation between two items and return value to caller. More...
 
 UpdateContentCorrelation ($ItemIdA, $ItemIdB)
 Calculate content correlation between two items and update in DB. More...
 
 NormalizeAndParseText ($Text)
 Normalize text string and parse into words. More...
 
 CalcTextCorrelation ($WordsA, $WordsB)
 Get value for correlation between two sets of words. More...
 
 ContentCorrelation ($ItemIdA, $ItemIdB, $NewCorrelation=-1)
 Get/set stored value for correlation between two items. More...
 
 FilterOnSuppliedFunctions ($Results)
 Run results through supplied filter functions. More...
 

Detailed Description

Definition at line 10 of file SPTRecommender.php.

Constructor & Destructor Documentation

SPTRecommender::__construct ( )

Member Function Documentation

SPTRecommender::GetFieldValue (   $ItemId,
  $FieldName 
)

Get value for a given field.

Parameters
int$ItemIdItem to retreive value from
string$FieldNameField name to retrieve
Returns
mixed Value for requested field

Definition at line 101 of file SPTRecommender.php.

SPTRecommender::QueueUpdateForItem (   $ItemOrItemId,
  $TaskPriority = NULL 
)

Queue a background update for a specified item.

Parameters
mixed$ItemOrItemIdItem or an int item id to update
mixed$TaskPriorityPriority to use for this task, if the default is not suitable

Definition at line 132 of file SPTRecommender.php.

static SPTRecommender::RunUpdateForItem (   $SourceItemId,
  $StartingIndex 
)
static

Perform recommender db updates for a specified item (usually in the background)

Parameters
int$SourceItemIdItemId for the source item in this update
int$StartingIndexStarting index of the destination items

Definition at line 163 of file SPTRecommender.php.

References Database\Caching(), and ApplicationFramework\PRIORITY_LOW.

static SPTRecommender::SetUpdatePriority (   $NewPriority)
static

Set the default priority for background tasks.

Parameters
mixed$NewPriorityNew task priority (one of ApplicationFramework::PRIORITY_*)

Definition at line 248 of file SPTRecommender.php.

References ApplicationFramework\PRIORITY_BACKGROUND.


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