CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

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

List of all members
PrivilegeFactory Class Reference

Factory which extracts all defined privileges from the database. More...

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

## Setup/Initialization
| __construct ()
| Object constructor. More...

## Accessors
| GetPrivileges ($IncludePredefined=TRUE, $ReturnObjects=TRUE)
| Get all privileges. More...
| GetPrivilegeWithName ($Name)
| Get the Privilege object with the given name. More...
| GetPrivilegeWithValue ($Value)
| Get the Privilege object with the given value. More...
| GetPredefinedPrivilegeConstants ()
| Get all predefined privilege constants and their values. More...
| GetItemNames ($SqlCondition=NULL)
| Retrieve human-readable privilege names. More...

## Predicates
| PrivilegeNameExists ($Name)
| Determine if a privilege with the given name exists. More...
| PrivilegeValueExists ($Value)
| Determine if a privilege with the given value exists. More...

## Additional Inherited Members
Public Member Functions inherited from ItemFactory
| __construct ($ItemClassName, $ItemTableName, $ItemIdFieldName, $ItemNameFieldName=NULL, $OrderOpsAllowed=FALSE, $SqlCondition=NULL)
| Class constructor. More...
| GetItemClassName ()
| Get class name of items manipulated by factory. More...
| CleanOutStaleTempItems ($MinutesUntilStale=10080)
| Clear out (call the Delete() method) for any temp items more than specified number of minutes old. 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, $Disabled=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...
| CachingEnabled ($NewValue=NULL)
| Enable/disable caching of item information. More...
| ClearCaches ()
| Clear item information caches. 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...
Protected Attributes inherited from ItemFactory
| $DB

## Detailed Description

Factory which extracts all defined privileges from the database.

Definition at line 14 of file PrivilegeFactory.php.

## Constructor & Destructor Documentation

PrivilegeFactory::__construct | ( |  | ) |

Object constructor.

Definition at line 23 of file PrivilegeFactory.php.

## Member Function Documentation

PrivilegeFactory::GetItemNames | ( |  | $SqlCondition = `NULL` | ) |

Retrieve human-readable privilege names.

This method overloads the inherited version from ItemFactory to add in the predefined privileges.

Parameters

  string | $SqlCondition | SQL condition (w/o "WHERE") for name retrieval. (OPTIONAL)

Returns
  array Array with item names as values and item IDs as indexes

Definition at line 180 of file PrivilegeFactory.php.

Referenced by GetPrivileges().

Here is the caller graph for this function:

PrivilegeFactory::GetPredefinedPrivilegeConstants | ( |  | ) |

Get all predefined privilege constants and their values.

Returns
  array An array with the privilege IDs for the index.

Definition at line 168 of file PrivilegeFactory.php.

PrivilegeFactory::GetPrivileges | ( |  | $IncludePredefined = `TRUE`,
|  |  | $ReturnObjects = `TRUE`
| ) |  |

Get all privileges.

Parameters

  bool | $IncludePredefined | Whether to include predefined privileges. (OPTIONAL, defaults to TRUE)
  bool | $ReturnObjects | Whether to return Privilege objects, rather than privilege names. (OPTIONAL, defaults to TRUE)

Returns
  An array of privilege objects or strings with priv IDs for the index.

Definition at line 53 of file PrivilegeFactory.php.

References GetItemNames().

Referenced by GetPrivilegeWithName(), GetPrivilegeWithValue(), PrivilegeNameExists(), and PrivilegeValueExists().

Here is the caller graph for this function:

PrivilegeFactory::GetPrivilegeWithName | ( |  | $Name | ) |

Get the Privilege object with the given name.

Parameters

  string | $Name | Privilege name.

Returns
  object A Privilege object or NULL if one doesn't exist with the name.

Definition at line 92 of file PrivilegeFactory.php.

References GetPrivileges().

PrivilegeFactory::GetPrivilegeWithValue | ( |  | $Value | ) |

Get the Privilege object with the given value.

Parameters

  int | $Value | Privilege value.

Returns
  object A Privilege object or NULL if one doesn't exist with the value.

Definition at line 136 of file PrivilegeFactory.php.

References GetPrivileges().

PrivilegeFactory::PrivilegeNameExists | ( |  | $Name | ) |

Determine if a privilege with the given name exists.

Parameters

  string | $Name | Privilege name.

Returns
  bool TRUE if a privilege with the given name exists.

Definition at line 198 of file PrivilegeFactory.php.

References GetPrivileges().

PrivilegeFactory::PrivilegeValueExists | ( |  | $Value | ) |

Determine if a privilege with the given value exists.

Parameters

  int | $Value | Privilege value.

Returns
  bool TRUE if a privilege with the value exists, otherwise FALSE.

Definition at line 230 of file PrivilegeFactory.php.

References GetPrivileges().

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

- objects/PrivilegeFactory.php