Class PrincipalService

Description

This Service Interface holds methods for loading and manipulating Prinicpals.

Receive an PrincipalService instance by calling:

  1.  $services ServiceFactory::get();
  2.  $principalService $services->getPrincipalService();

Make sure to use the right funtion to set User values:

setAttributes() for all Metadata like the values within the User Admin Plugin. setParemeter() for special values like User Language and active Flag.

  • version: $Id: PrincipalService.php,v 1.2 2006/11/26 22:04:37 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • author: Kevin Papst
  • license: GNU Public License


			
Direct descendents
Class Description
DefaultPrincipalService Default implementation of the BIGACE PrincipalService.
Method Summary
PrincipalService PrincipalService ()
mixed createPrincipal ( $name,  $password,  $language)
boolean deleteAttributes ( $principal)
boolean deletePrincipal ( $principal)
array getAllPrincipals ()
array getAttributes ( $principal)
mixed getParameter ( $principal,  $parameter)
mixed lookup ( $principalName)
mixed lookupByID ( $principalID)
boolean setAttribute ( $principal,  $attribute,  $value)
boolean setParameter ( $principal,  $parameter,  $value)
Methods
Constructor PrincipalService (line 62)
PrincipalService PrincipalService ()
createPrincipal (line 126)

Creates a Principal.

Returns false if the Principal could not be created.

  • return: the Principal or false
mixed createPrincipal ( $name,  $password,  $language)
  • $name
  • $password
  • $language

Redefined in descendants as:
deleteAttributes (line 91)

Deletes the attributes for the given Principal.

If second parameter is null or an empty array all attributes will be removed, otherwise we try to remove all Attributes provided in the array:

  1. array('phone','street')

  • return: true on success otherwise false
boolean deleteAttributes ( $principal)
  • $principal

Redefined in descendants as:
deletePrincipal (line 135)

Deletes a Principal.

Returns false if the Principal could not be deleted.

  • return: true on success otherwise false
boolean deletePrincipal ( $principal)
  • $principal

Redefined in descendants as:
getAllPrincipals (line 99)

Get an Array with all available Principals.

  • return: an array with Principal instances
array getAllPrincipals ()

Redefined in descendants as:
getAttributes (line 72)

Returns the Principal Attributes as a key-value mapped Array.

If no Attributes could be found it returns an empty array.

  • return: the Principal Attributes
array getAttributes ( $principal)
  • $principal

Redefined in descendants as:
getParameter (line 166)

Gets the given Parameter for the Principal.

If the passed Parameter could not be found or is invalid null will be returned.

The allowed Parameter are:

  • PRINCIPAL_PARAMETER_PASSWORD
  • PRINCIPAL_PARAMETER_ACTIVE
  • PRINCIPAL_PARAMETER_LANGUAGE

  • return: the value or null if not found
mixed getParameter ( $principal,  $parameter)
  • $principal
  • $parameter

Redefined in descendants as:
lookup (line 108)

Tries to find a Principal with the given Name.

Returns null if none could be found.

  • return: a Principal or null
mixed lookup ( $principalName)
  • $principalName

Redefined in descendants as:
lookupByID (line 117)

Tries to find a Principal with the given ID.

Returns null if none could be found.

  • return: a Principal or null
mixed lookupByID ( $principalID)
  • $principalID

Redefined in descendants as:
setAttribute (line 80)

Sets the attribute-value mapping for the given Principal.

  • return: true on success otherwise false
boolean setAttribute ( $principal,  $attribute,  $value)
  • $principal
  • $attribute
  • $value

Redefined in descendants as:
setParameter (line 149)

Sets the given Parameter for the Principal.

The allowed Parameter are:

  • PRINCIPAL_PARAMETER_PASSWORD
  • PRINCIPAL_PARAMETER_ACTIVE
  • PRINCIPAL_PARAMETER_LANGUAGE

  • return: true on success otherwise false
boolean setParameter ( $principal,  $parameter,  $value)
  • $principal
  • $parameter
  • $value

Redefined in descendants as:

Documentation generated by phpDocumentor 1.3.1