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
| PrivilegeFactory ()
| Object constructor.

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

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

## Additional Inherited Members
Public Member Functions inherited from ItemFactory
| ItemFactory ($ItemClassName, $ItemTableName, $ItemIdFieldName, $ItemNameFieldName=NULL, $FieldId=NULL, $OrderOpsAllowed=FALSE)
| Status ()
| GetCurrentEditedItemId ()
| SetCurrentEditedItemId ($NewId)
| ClearCurrentEditedItemId ()
| ClearCurrentEditedItem ()
| CleanOutStaleTempItems ($MinutesUntilStale=10080)
| Clear out (call the Delete() method) for any temp items more than specified number of minutes old.
| GetLastTempItemId ()
| GetNextItemId ()
| GetHighestItemId ($Condition=NULL, $IncludeTempItems=FALSE)
| GetNextTempItemId ()
| GetItemCount ($Condition=NULL, $IncludeTempItems=FALSE)
| GetItemIds ($Condition=NULL, $IncludeTempItems=FALSE)
| GetLatestModificationDate ($Condition=NULL)
| GetItem ($ItemId)
| ItemExists ($ItemId)
| Check that item exists with specified ID.
| GetItemByName ($Name, $IgnoreCase=FALSE)
| GetItemNames ($SqlCondition=NULL)
| Retrieve item names.
| GetItems ($SqlCondition=NULL)
| Retrieve items.
| 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.
| NameIsInUse ($Name, $IgnoreCase=FALSE)
| Check whether item name is currently in use.
| SearchForItemNames ($SearchString, $NumberOfResults=100, $IncludeVariants=FALSE, $UseBooleanMode=TRUE, $Offset=0)
| GetCountForItemNames ($SearchString, $IncludeVariants=FALSE, $UseBooleanMode=TRUE)
| AddItems ($ItemNames, $Qualifier=NULL)
| add items with specified names
| AddItem ($ItemName, $AdditionalValues=NULL)
| Add new item.
| DeleteItem ($ItemId)
| Delete item.
| SetOrderOpsCondition ($Condition)
| InsertBefore ($SourceItemOrItemId, $TargetItemOrItemId)
| InsertAfter ($SourceItemOrItemId, $TargetItemOrItemId)
| Prepend ($ItemOrItemId)
| Append ($ItemOrItemId)
| GetItemIdsInOrder ($AddStrayItemsToOrder=TRUE)
| RemoveItemFromOrder ($ItemId)
Protected Attributes inherited from ItemFactory
| $DB
| $FieldId

## Detailed Description

Factory which extracts all defined privileges from the database.

Definition at line 24 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

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

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

Definition at line 186 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
  an array with the privilege ID as the key

Definition at line 175 of file PrivilegeFactory.php.

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

Get all privileges.

Parameters

  IncludePredefined | (OPTIONAL)
  ReturnObjects | (OPTIONAL)

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

Definition at line 60 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

  $Name | privilege name

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

Definition at line 99 of file PrivilegeFactory.php.

References GetPrivileges().

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

Get the Privilege object with the given value.

Parameters

  $Value | privilege value

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

Definition at line 143 of file PrivilegeFactory.php.

References GetPrivileges().

PrivilegeFactory::PrivilegeFactory | ( |  | ) |

Object constructor.

Definition at line 32 of file PrivilegeFactory.php.

References ItemFactory\ItemFactory().

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

Determine if a privilege with the given name exists.

Parameters

  $Name | privilege name

Returns
  TRUE if a privilege with the given name exists

Definition at line 204 of file PrivilegeFactory.php.

References GetPrivileges().

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

Determine if a privilege with the given value exists.

Parameters

  $Value | privilege value

Returns
  TRUE if a privilege with the given value exists

Definition at line 236 of file PrivilegeFactory.php.

References GetPrivileges().

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

- objects/PrivilegeFactory.php