Class HarmoniProperties

Description

Properties is a mechanism for returning read-only data about an object. An object can have data associated with a PropertiesType. For each PropertiesType, there are Properties which are Serializable values identified by a key.

OSID Version: 2.0

  • version: $Id: HarmoniProperties.class.php,v 1.17 2007/09/04 20:25:48 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/oki2/shared/HarmoniProperties.class.php (line 24)

Properties
   |
   --HarmoniProperties
Direct descendents
Class Description
ConfigurationProperties Properties for configuring Managers
NonReferenceProperties Properties that can be added to without doing so by reference. Useful for building Properties of strings, integers, etc.
Method Summary
object HarmoniProperties (object Type $type)
void addProperty (mixed $key, mixed $value)
void deleteProperty (mixed $key)
object ObjectIterator getKeys ()
object mixed getProperty (object mixed $key)
object Type getType ()
Methods
Constructor HarmoniProperties (line 36)

Constructor. Create a new Properties object.

  • since: 11/18/04
  • access: public
object HarmoniProperties (object Type $type)
  • object Type $type
addProperty (line 143)

Add a Property to these Properties.

WARNING: NOT IN OSID - This method is not in the OSIDs as of version 2.0 Use at your own risk

Since PHP4's reference handling sucks royally and call-time-pass-by-reference currently throws errors since it is depricated, there is no way to pass objects as references and primatives by value to the same arguement. As such, in order to allow Properties to hold references to objects (such as in an Osid Context or Osid Configuration) the param-by reference must stay. To pass strings or other primatives you must set the primatives to variables first as in the following example:

$configuration = new HarmoniProperties(new ConfigurationPropertiesType); $configuration->addProperty('database_id', $arg1 = 0); $configuration->addProperty('authentication_table', $arg2 = 'auth_db_user'); $configuration->addProperty('username_field', $arg3 = 'username'); $configuration->addProperty('password_field', $arg4 = 'password'); unset($arg1, $arg2, $arg3, $arg4);

  • since: 11/18/04
  • access: public
void addProperty (mixed $key, mixed $value)
  • mixed $key
  • mixed $value

Redefined in descendants as:
deleteProperty (line 153)

Remove a Property from these properties

WARNING: NOT IN OSID - This method is not in the OSIDs as of version 2.0 Use at your own risk

void deleteProperty (mixed $key)
getKeys (line 106)

Get the Keys associated with these Properties.

  • access: public
  • throws: object SharedException An exception with one of the following messages defined in org.osid.shared.SharedException may be thrown: UNKNOWN_TYPE, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object ObjectIterator getKeys ()

Redefinition of:
Properties::getKeys()
Get the Keys associated with these Properties.
getProperty (line 83)

Get the Property associated with this key.

  • return: (original type: java.io.Serializable)
  • access: public
  • throws: object SharedException An exception with one of the following messages defined in org.osid.shared.SharedException may be thrown: UNKNOWN_TYPE, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, UNKNOWN_KEY
object mixed getProperty (object mixed $key)
  • object mixed $key: (original type: java.io.Serializable)

Redefinition of:
Properties::getProperty()
Get the Property associated with this key.
getType (line 59)

Get the Type for this Properties instance.

  • access: public
  • throws: object SharedException An exception with one of the following messages defined in org.osid.shared.SharedException may be thrown: UNKNOWN_TYPE, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object Type getType ()

Redefinition of:
Properties::getType()
Get the Type for this Properties instance.

Inherited Methods

Inherited From Properties

Properties::getKeys()
Properties::getProperty()
Properties::getType()

Documentation generated on Wed, 19 Sep 2007 10:24:10 -0400 by phpDocumentor 1.3.0RC3