|
| __construct () |
|
| Delete ($Category, $ReplacementCategoryID) |
|
| GetByCode ($Code) |
|
| GetID ($CategoryID) |
|
| Get ($OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) |
|
| GetAll () |
|
| GetDescendantCountByCode ($Code) |
|
| GetDescendantsByCode ($Code) |
|
| GetFull ($CategoryID= '', $Permissions=FALSE) |
|
| GetFullByUrlCode ($UrlCode) |
|
| HasChildren ($CategoryID) |
|
| RebuildTree () |
|
| SaveTree ($TreeArray) |
|
| Save ($FormPostValues) |
|
| SaveUserTree ($CategoryID, $Set) |
|
| SetField ($ID, $Property, $Value=FALSE) |
|
| ApplyUpdates () |
|
| __construct ($Name= '') |
|
| DefineSchema () |
|
| Save ($FormPostValues, $Settings=FALSE) |
|
| Insert ($Fields) |
|
| Update ($Fields, $Where=FALSE, $Limit=FALSE) |
|
| Delete ($Where= '', $Limit=FALSE, $ResetData=FALSE) |
|
| FilterForm ($Data) |
|
| FilterSchema ($Data) |
|
| Get ($OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) |
|
| GetCount ($Wheres= '') |
|
| GetID ($ID, $DatasetType=FALSE) |
|
| GetWhere ($Where=FALSE, $OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) |
|
| ValidationResults () |
|
| Validate ($FormPostValues, $Insert=FALSE) |
|
| SaveToSerializedColumn ($Column, $RowID, $Name, $Value= '') |
|
| SetProperty ($RowID, $Property, $ForceValue=FALSE) |
|
| __construct () |
|
| GetReturn ($PluginName, $HandlerName) |
|
| FireEvent ($EventName) |
|
| __call ($MethodName, $Arguments) |
|
| EnableSlicing (&$Sender) |
|
| Slice ($SliceName, $Arguments=array()) |
|
| AddSliceAsset ($Asset) |
|
| RenderSliceConfig () |
|
Class constructor. Defines the related database table name.
- Since
- 2.0.0 public
_SetTree |
( |
& |
$Node, |
|
|
|
$Left = 1 , |
|
|
|
$Depth = 0 |
|
) |
| |
|
protected |
- Since
- 2.0.18 protected
- Parameters
-
array | $Node | |
int | $Left | |
int | $Depth | |
Utility method for sorting via usort.
- Since
- 2.0.18 protected
- Parameters
-
$A | First element to compare. |
$B | Second element to compare. |
- Returns
- int -1, 1, 0 (per usort)
static AddCategoryColumns |
( |
|
$Data | ) |
|
|
static |
Modifies category data before it is returned.
Adds CountAllDiscussions column to each category representing the sum of discussions within this category as well as all subcategories.
- Since
- 2.0.17 public
- Parameters
-
If looking at the root node, make sure it exists and that the nested set columns exist in the table.
- Since
- 2.0.15 public
static CalculateData |
( |
& |
$Data | ) |
|
|
staticprotected |
- Since
- 2.0.18 public
- Parameters
-
static Categories |
( |
|
$ID = FALSE | ) |
|
|
static |
- Since
- 2.0.18 public
- Parameters
-
- Returns
- object DataObject
- Since
- 2.0.18 public
- Returns
- array Category IDs.
Delete |
( |
|
$Category, |
|
|
|
$ReplacementCategoryID |
|
) |
| |
Delete a single category and assign its discussions to another.
- Since
- 2.0.0 public
- Parameters
-
object | $Category | |
int | $ReplacementCategoryID | Unique ID of category all discussion are being move to. |
Get |
( |
|
$OrderFields = '' , |
|
|
|
$OrderDirection = 'asc' , |
|
|
|
$Limit = FALSE , |
|
|
|
$Offset = FALSE |
|
) |
| |
Get list of categories (respecting user permission).
- Since
- 2.0.0 public
- Parameters
-
string | $OrderFields | Ignored. |
string | $OrderDirection | Ignored. |
int | $Limit | Ignored. |
int | $Offset | Ignored. |
- Returns
- Gdn_DataSet SQL results.
Get list of categories (disregarding user permission for admins).
- Since
- 2.0.0 public
- Parameters
-
string | $OrderFields | Ignored. |
string | $OrderDirection | Ignored. |
int | $Limit | Ignored. |
int | $Offset | Ignored. |
- Returns
- object SQL results.
static GetAncestors |
( |
|
$CategoryID, |
|
|
|
$CheckPermissions = TRUE |
|
) |
| |
|
static |
Get all of the ancestor categories above this one.
- Parameters
-
int | string | $Category | The category ID or url code. |
bool | $CheckPermissions | Whether or not to only return the categories with view permission. |
- Returns
- array
Get data for a single category selected by Url Code. Disregards permissions.
- Since
- 2.0.0 public
- Parameters
-
int | $CodeID | Unique Url Code of category we're getting data for. |
- Returns
- object SQL results.
GetDescendantCountByCode |
( |
|
$Code | ) |
|
Return the number of descendants for a specific category.
GetDescendantsByCode |
( |
|
$Code | ) |
|
- Since
- 2.0.18 public
- Parameters
-
string | $Code | Where condition. |
- Returns
- object DataSet
GetFull |
( |
|
$CategoryID = '' , |
|
|
|
$Permissions = FALSE |
|
) |
| |
Get full data for a single category or all categories. Respects Permissions.
If no CategoryID is provided, it gets all categories.
- Since
- 2.0.0 public
- Parameters
-
int | $CategoryID | Unique ID of category to return. |
string | $Permissions | Permission to check. |
- Returns
- object SQL results.
GetFullByUrlCode |
( |
|
$UrlCode | ) |
|
Get full data for a single category by its URL slug. Respects permissions.
- Since
- 2.0.0 public
- Parameters
-
string | $UrlCode | Unique category slug from URL. |
- Returns
- object SQL results.
Get data for a single category selected by ID. Disregards permissions.
- Since
- 2.0.0 public
- Parameters
-
int | $CategoryID | Unique ID of category we're getting data for. |
- Returns
- object SQL results.
- Since
- 2.0.18 public
- Parameters
-
- Returns
- array
HasChildren |
( |
|
$CategoryID | ) |
|
Check whether category has any children categories.
- Since
- 2.0.0 public
- Parameters
-
string | $CategoryID | Unique ID for category being checked. |
- Returns
- bool
static JoinCategories |
( |
& |
$Data, |
|
|
|
$Column = 'CategoryID' , |
|
|
|
$Options = array() |
|
) |
| |
|
static |
- Since
- 2.0.18 public
- Parameters
-
array | $Data | Dataset. |
string | $Column | Name of database column. |
array | $Options | 'Join' key may contain array of columns to join on. |
static JoinModerators |
( |
|
$Data, |
|
|
|
$Permission = 'Vanilla.Comments.Edit' , |
|
|
|
$Column = 'Moderators' |
|
) |
| |
|
static |
- Since
- 2.0.0 public
- Parameters
-
array | $Data | |
string | $Permission | |
string | $Column | |
static JoinUserData |
( |
& |
$Categories, |
|
|
|
$AddUserCategory = TRUE |
|
) |
| |
|
static |
- Since
- 2.0.18 public
- Parameters
-
array | $Categories | |
bool | $AddUserCategory | |
Rebuilds the category tree. We are using the Nested Set tree model.
http://articles.sitepoint.com/article/hierarchical-data-database/2 http://en.wikipedia.org/wiki/Nested_set_model
- Since
- 2.0.0 public
Saves the category.
- Since
- 2.0.0 public
- Parameters
-
array | $FormPostValue | The values being posted back from the form. |
- Returns
- int ID of the saved category.
Saves the category tree based on a provided tree array. We are using the Nested Set tree model.
http://articles.sitepoint.com/article/hierarchical-data-database/2 http://en.wikipedia.org/wiki/Nested_set_model
- Since
- 2.0.16 public
- Parameters
-
array | $TreeArray | A fully defined nested set model of the category tree. |
SaveUserTree |
( |
|
$CategoryID, |
|
|
|
$Set |
|
) |
| |
Grab the Category IDs of the tree.
- Since
- 2.0.18 public
- Parameters
-
static SetCache |
( |
|
$ID = FALSE , |
|
|
|
$Data = FALSE |
|
) |
| |
|
static |
Grab the categories from the cache.
- Since
- 2.0.18 public
- Parameters
-
SetField |
( |
|
$ID, |
|
|
|
$Property, |
|
|
|
$Value = FALSE |
|
) |
| |
The documentation for this class was generated from the following file: