Class: PrincipalService

Source Location: /CORE/system/api/principal/PrincipalService.php

Class PrincipalService

Class Overview

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.

Located in /CORE/system/api/principal/PrincipalService.php [line 63]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: PrincipalService.php,v 1.4 2007/12/27 21:38:59 kpapst Exp $
Copyright:  Copyright (C) 2002-2006 Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Descendants
Child Class Description
DefaultPrincipalService Default implementation of the BIGACE PrincipalService.

[ Top ]
Method Summary
PrincipalService   PrincipalService()  
mixed   createPrincipal()   Creates a Principal.
boolean   deleteAttributes()   Deletes all attributes for the given Principal.
boolean   deletePrincipal()   Deletes a Principal.
array   getAllPrincipals()   Get an Array with all available Principals.
array   getAttributes()   Returns the Principal Attributes as a key-value mapped Array.
mixed   getParameter()   Gets the given Parameter for the Principal.
mixed   lookup()   Tries to find a Principal with the given Name.
mixed   lookupByID()   Tries to find a Principal with the given ID.
boolean   setAttribute()   Sets the attribute-value mapping for the given Principal.
boolean   setParameter()   Sets the given Parameter for the Principal.

[ Top ]
Methods
Constructor PrincipalService  [line 66]

  PrincipalService PrincipalService( )



[ Top ]
createPrincipal  [line 131]

  mixed createPrincipal( $name, $password, $language  )

Creates a Principal.

Returns false if the Principal could not be created.

Parameters:
   $name: 
   $password: 
   $language: 

API Tags:
Return:  the Principal or false


Redefined in descendants as:

[ Top ]
deleteAttributes  [line 92]

  boolean deleteAttributes( $principal  )

Deletes all attributes for the given Principal.

Parameters:
   $principal: 

API Tags:
Return:  true on success otherwise false


Redefined in descendants as:

[ Top ]
deletePrincipal  [line 140]

  boolean deletePrincipal( $principal  )

Deletes a Principal.

Returns false if the Principal could not be deleted.

Parameters:
   $principal: 

API Tags:
Return:  true on success otherwise false


Redefined in descendants as:

[ Top ]
getAllPrincipals  [line 104]

  array getAllPrincipals( )

Get an Array with all available Principals.


API Tags:
Return:  an array with Principal instances


Redefined in descendants as:

[ Top ]
getAttributes  [line 76]

  array getAttributes( $principal  )

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

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

Parameters:
   $principal: 

API Tags:
Return:  the Principal Attributes


Redefined in descendants as:

[ Top ]
getParameter  [line 171]

  mixed getParameter( $principal, $parameter  )

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

Parameters:
   $principal: 
   $parameter: 

API Tags:
Return:  the value or null if not found


Redefined in descendants as:

[ Top ]
lookup  [line 113]

  mixed lookup( $principalName  )

Tries to find a Principal with the given Name.

Returns null if none could be found.

Parameters:
   $principalName: 

API Tags:
Return:  a Principal or null


Redefined in descendants as:

[ Top ]
lookupByID  [line 122]

  mixed lookupByID( $principalID  )

Tries to find a Principal with the given ID.

Returns null if none could be found.

Parameters:
   $principalID: 

API Tags:
Return:  a Principal or null


Redefined in descendants as:

[ Top ]
setAttribute  [line 84]

  boolean setAttribute( $principal, $attribute, $value  )

Sets the attribute-value mapping for the given Principal.

Parameters:
   $principal: 
   $attribute: 
   $value: 

API Tags:
Return:  true on success otherwise false


Redefined in descendants as:

[ Top ]
setParameter  [line 154]

  boolean setParameter( $principal, $parameter, $value  )

Sets the given Parameter for the Principal.

The allowed Parameter are:

  • PRINCIPAL_PARAMETER_PASSWORD
  • PRINCIPAL_PARAMETER_ACTIVE
  • PRINCIPAL_PARAMETER_LANGUAGE

Parameters:
   $principal: 
   $parameter: 
   $value: 

API Tags:
Return:  true on success otherwise false


Redefined in descendants as:

[ Top ]