CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

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

Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Recommender Class Reference
Inheritance diagram for Recommender:
[legend]

## Public Member Functions
| __construct (&$DB, $ItemTableName, $RatingTableName, $ItemIdFieldName, $UserIdFieldName, $RatingFieldName, $ContentFields)
| DebugLevel ($Setting)
| Recommend ($UserId, $StartingResult=0, $NumberOfResults=10)
| AddResultFilterFunction ($FunctionName)
| NumberOfResults ()
| SearchTime ()
| GetSourceList ($UserId, $RecommendedItemId)
| FindSimilarItems ($ItemId, $FieldList=NULL)
| RecommendFieldValues ($ItemId, $FieldList=NULL)
| UpdateForItems ($StartingItemId, $NumberOfItems)
| UpdateForItem ($ItemId, $FullPass=FALSE)
| DropItem ($ItemId)
| PruneCorrelations ()
| GetItemIds ()
| Retrieve all item IDs. More...

## Static Public Member Functions
static | ClearCaches ()
| Clear internal caches of item and correlation data. More...

## Public Attributes
const | CONTENTFIELDTYPE_TEXT = 1
const | CONTENTFIELDTYPE_NUMERIC = 2
const | CONTENTFIELDTYPE_CONTROLLEDNAME = 3
const | CONTENTFIELDTYPE_DATE = 4
const | CONTENTFIELDTYPE_DATERAMGE = 5

## Protected Member Functions
| LoadItemIds ()
| GetFieldData ($ItemId, $FieldName)
| CalculateContentCorrelation ($ItemIdA, $ItemIdB, $FieldList=NULL)
| UpdateContentCorrelation ($ItemIdA, $ItemIdB)
| NormalizeAndParseText ($Text)
| CalcTextCorrelation ($WordsA, $WordsB)
| ContentCorrelation ($ItemIdA, $ItemIdB, $NewCorrelation=-1)
| FilterOnSuppliedFunctions ($Results)

## Detailed Description

Definition at line 11 of file Recommender.php.

## Constructor & Destructor Documentation

Recommender::__construct | ( | & | $DB,
|  |  | $ItemTableName,
|  |  | $RatingTableName,
|  |  | $ItemIdFieldName,
|  |  | $UserIdFieldName,
|  |  | $RatingFieldName,
|  |  | $ContentFields
| ) |  |

Definition at line 22 of file Recommender.php.

References DebugLevel().

## Member Function Documentation

Recommender::AddResultFilterFunction | ( |  | $FunctionName | ) |

Definition at line 162 of file Recommender.php.

Recommender::CalcTextCorrelation | ( |  | $WordsA,
|  |  | $WordsB
| ) |  |
| protected

Definition at line 778 of file Recommender.php.

Referenced by CalculateContentCorrelation().

Here is the caller graph for this function:

Recommender::CalculateContentCorrelation | ( |  | $ItemIdA,
|  |  | $ItemIdB,
|  |  | $FieldList = `NULL`
| ) |  |
| protected

Definition at line 585 of file Recommender.php.

References CalcTextCorrelation(), DebugLevel(), and GetFieldData().

Referenced by FindSimilarItems(), and UpdateContentCorrelation().

Here is the caller graph for this function:

static Recommender::ClearCaches | ( |  | ) |
| static

Clear internal caches of item and correlation data.

This is primarily intended for situations where memory may have run low.

Definition at line 516 of file Recommender.php.

Recommender::ContentCorrelation | ( |  | $ItemIdA,
|  |  | $ItemIdB,
|  |  | $NewCorrelation = `-1`
| ) |  |
| protected

Definition at line 787 of file Recommender.php.

Referenced by UpdateContentCorrelation().

Here is the caller graph for this function:

Recommender::DebugLevel | ( |  | $Setting | ) |

Definition at line 45 of file Recommender.php.

Referenced by __construct(), CalculateContentCorrelation(), FindSimilarItems(), Recommend(), RecommendFieldValues(), UpdateContentCorrelation(), UpdateForItem(), and UpdateForItems().

Here is the caller graph for this function:

Recommender::DropItem | ( |  | $ItemId | ) |

Definition at line 475 of file Recommender.php.

Recommender::FilterOnSuppliedFunctions | ( |  | $Results | ) |
| protected

Definition at line 839 of file Recommender.php.

Referenced by FindSimilarItems().

Here is the caller graph for this function:

Recommender::FindSimilarItems | ( |  | $ItemId,
|  |  | $FieldList = `NULL`
| ) |  |

Definition at line 218 of file Recommender.php.

References CalculateContentCorrelation(), DebugLevel(), FilterOnSuppliedFunctions(), and LoadItemIds().

Referenced by RecommendFieldValues().

Here is the caller graph for this function:

Recommender::GetFieldData | ( |  | $ItemId,
|  |  | $FieldName
| ) |  |
| protected

Definition at line 560 of file Recommender.php.

References NormalizeAndParseText().

Referenced by CalculateContentCorrelation().

Here is the caller graph for this function:

Recommender::GetItemIds | ( |  | ) |

Retrieve all item IDs.

Returns
  Array of item IDs.

Definition at line 501 of file Recommender.php.

Recommender::GetSourceList | ( |  | $UserId,
|  |  | $RecommendedItemId
| ) |  |

Definition at line 181 of file Recommender.php.

Recommender::LoadItemIds | ( |  | ) |
| protected

Definition at line 544 of file Recommender.php.

Referenced by FindSimilarItems(), UpdateForItem(), and UpdateForItems().

Here is the caller graph for this function:

Recommender::NormalizeAndParseText | ( |  | $Text | ) |
| protected

Definition at line 686 of file Recommender.php.

Referenced by GetFieldData().

Here is the caller graph for this function:

Recommender::NumberOfResults | ( |  | ) |

Definition at line 169 of file Recommender.php.

Recommender::PruneCorrelations | ( |  | ) |

Definition at line 483 of file Recommender.php.

Recommender::Recommend | ( |  | $UserId,
|  |  | $StartingResult = `0`,
|  |  | $NumberOfResults = `10`
| ) |  |

Definition at line 54 of file Recommender.php.

References DebugLevel().

Recommender::RecommendFieldValues | ( |  | $ItemId,
|  |  | $FieldList = `NULL`
| ) |  |

Definition at line 279 of file Recommender.php.

References DebugLevel(), and FindSimilarItems().

Recommender::SearchTime | ( |  | ) |

Definition at line 175 of file Recommender.php.

Recommender::UpdateContentCorrelation | ( |  | $ItemIdA,
|  |  | $ItemIdB
| ) |  |
| protected

Definition at line 671 of file Recommender.php.

References CalculateContentCorrelation(), ContentCorrelation(), and DebugLevel().

Referenced by UpdateForItem().

Here is the caller graph for this function:

Recommender::UpdateForItem | ( |  | $ItemId,
|  |  | $FullPass = `FALSE`
| ) |  |

Definition at line 449 of file Recommender.php.

References DebugLevel(), LoadItemIds(), and UpdateContentCorrelation().

Referenced by UpdateForItems().

Here is the caller graph for this function:

Recommender::UpdateForItems | ( |  | $StartingItemId,
|  |  | $NumberOfItems
| ) |  |

Definition at line 408 of file Recommender.php.

References DebugLevel(), LoadItemIds(), and UpdateForItem().

## Member Data Documentation

const Recommender::CONTENTFIELDTYPE_CONTROLLEDNAME = 3

Definition at line 17 of file Recommender.php.

const Recommender::CONTENTFIELDTYPE_DATE = 4

Definition at line 18 of file Recommender.php.

Referenced by SPTRecommender\__construct().

const Recommender::CONTENTFIELDTYPE_DATERAMGE = 5

Definition at line 19 of file Recommender.php.

const Recommender::CONTENTFIELDTYPE_NUMERIC = 2

Definition at line 16 of file Recommender.php.

Referenced by SPTRecommender\__construct().

const Recommender::CONTENTFIELDTYPE_TEXT = 1

Definition at line 15 of file Recommender.php.

Referenced by SPTRecommender\__construct().

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

- objects/Recommender.php