mojavi
[ class tree: mojavi ] [ index: mojavi ] [ all elements ]

Class: User

Source Location: /user/User.class.php

Class Overview

ParameterHolder
   |
   --User

User wraps a client session and provides accessor methods for user attributes. It also makes storing and retrieving multiple page form data rather easy by allowing user attributes to be stored in namespaces, which help organize data.


Author(s):

  • Sean Kerr (skerr@mojavi.org)

Version:

  • $Id: User.class.php 761 2005-01-29 06:20:01Z seank $

Copyright:

Constants

Methods


Child classes:

SecurityUser
SecurityUser provides advanced security manipulation methods.

Inherited Variables

Inherited Methods

Class: ParameterHolder

ParameterHolder::clearParameters()
Clear all parameters associated with this request.
ParameterHolder::getParameter()
Retrieve a parameter.
ParameterHolder::getParameterNames()
Retrieve an array of parameter names.
ParameterHolder::getParameters()
Retrieve an array of parameters.
ParameterHolder::hasParameter()
Indicates whether or not a parameter exists.
ParameterHolder::removeParameter()
Remove a parameter.
ParameterHolder::setParameter()
Set a parameter.
ParameterHolder::setParameterByRef()
Set a parameter by reference.
ParameterHolder::setParameters()
Set an array of parameters.
ParameterHolder::setParametersByRef()
Set an array of parameters by reference.

Class Details

[line 26]
User wraps a client session and provides accessor methods for user attributes. It also makes storing and retrieving multiple page form data rather easy by allowing user attributes to be stored in namespaces, which help organize data.



Tags:

version:  $Id: User.class.php 761 2005-01-29 06:20:01Z seank $
since:  1.0.0
copyright:  (c) Sean Kerr, http://www.mojavi.org
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]


Class Methods


method clearAttributes [line 59]

void clearAttributes( )

Clear all attributes associated with this user.



Tags:

access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getAttribute [line 81]

mixed &getAttribute( string $name, [string $ns = MO_USER_NAMESPACE])

Retrieve an attribute.



Tags:

return:  An attribute value, if the attribute exists, otherwise null.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.
string   $ns   An attribute namespace.

[ Top ]

method getAttributeNames [line 111]

array getAttributeNames( [string $ns = MO_USER_NAMESPACE])

Retrieve an array of attribute names.



Tags:

return:  An indexed array of attribute names, if the namespace exists, otherwise null.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $ns   An attribute namespace.

[ Top ]

method getAttributeNamespace [line 137]

array &getAttributeNamespace( [string $ns = MO_USER_NAMESPACE])

Retrieve all attributes within a namespace.



Tags:

return:  An associative array of attributes.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $ns   An attribute namespace.

[ Top ]

method getAttributeNamespaces [line 163]

array getAttributeNamespaces( )

Retrieve an array of attribute namespaces.



Tags:

return:  An indexed array of attribute namespaces.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getContext [line 180]

Context getContext( )

Retrieve the current application context.



Tags:

return:  A Context instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method hasAttribute [line 200]

bool hasAttribute( string $name, [string $ns = MO_USER_NAMESPACE])

Indicates whether or not an attribute exists.



Tags:

return:  true, if the attribute exists, otherwise false.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.
string   $ns   An attribute namespace.

[ Top ]

method hasAttributeNamespace [line 226]

bool hasAttributeNamespace( string $ns)

Indicates whether or not an attribute namespace exists.



Tags:

return:  true, if the namespace exists, otherwise false.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $ns   An attribute namespace.

[ Top ]

method initialize [line 250]

bool initialize( Context $context, [array $parameters = null])

Initialize this User.



Tags:

return:  true, if initialization completes successfully, otherwise false.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  InitializationException If an error occurs while initializing this User.


Overridden in child classes as:

BasicSecurityUser::initialize()
Initialize this User.

Parameters:

Context   $context   A Context instance.
array   $parameters   An associative array of initialization parameters.

[ Top ]

method newInstance [line 292]

User newInstance( string $class)

Retrieve a new User implementation instance.



Tags:

return:  A User implementation instance.
static:  
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  FactoryException If a user implementation instance cannot be created.


Parameters:

string   $class   A User implementation name

[ Top ]

method removeAttribute [line 327]

mixed &removeAttribute( string $name, [string $ns = MO_USER_NAMESPACE])

Remove an attribute.



Tags:

return:  An attribute value, if the attribute was removed, otherwise null.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.
string   $ns   An attribute namespace.

[ Top ]

method removeAttributeNamespace [line 358]

void removeAttributeNamespace( string $ns)

Remove an attribute namespace and all of its associated attributes.



Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $ns   An attribute namespace.

[ Top ]

method setAttribute [line 387]

void setAttribute( string $name, mixed $value, [string $ns = MO_USER_NAMESPACE])

Set an attribute.

If an attribute with the name already exists the value will be overridden.




Tags:

access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.
mixed   $value   An attribute value.
string   $ns   An attribute namespace.

[ Top ]

method setAttributeByRef [line 418]

void setAttributeByRef( string $name, mixed &$value, [string $ns = MO_USER_NAMESPACE])

Set an attribute by reference.

If an attribute with the name already exists the value will be overridden.




Tags:

access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.
mixed   &$value   A reference to an attribute value.
string   $ns   An attribute namespace.

[ Top ]

method setAttributes [line 449]

void setAttributes( array $attributes, [string $ns = MO_USER_NAMESPACE])

Set an array of attributes.

If an existing attribute name matches any of the keys in the supplied array, the associated value will be overridden.




Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

array   $attributes   An associative array of attributes and their associated values.
string   $ns   An attribute namespace.

[ Top ]

method setAttributesByRef [line 481]

void setAttributesByRef( array &$attributes, [string $ns = MO_USER_NAMESPACE])

Set an array of attributes by reference.

If an existing attribute name matches any of the keys in the supplied array, the associated value will be overridden.




Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

array   &$attributes   An associative array of attributes and references to their associated values.
string   $ns   An attribute namespace.

[ Top ]

method shutdown [line 510]

void shutdown( )

Execute the shutdown procedure.



Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

BasicSecurityUser::shutdown()
Execute the shutdown procedure.

[ Top ]


Class Constants

ATTRIBUTE_NAMESPACE =  'org/mojavi/user/User/attributes'

[line 38]

The namespace under which attributes will be stored.



Tags:

since:  3.0.0

[ Top ]



Documentation generated on Tue, 21 Feb 2006 01:45:29 +0900 by phpDocumentor 1.3.0RC5