Class HarmoniPropertyManager

Description

<p>

Property manager handles the process of storing and retrieving agent properties in the database. It also contains functionality to get database info on property types. It was designed to work with HarmoniEditableAgent which implements functionality to modify, in the context of the program properties and other agent attributes. This manager allows the program to store those changes. </p>

<p> THIS MANAGER IS NOT IN THE OSID 2.0! However it does follow the outline of a normal OSID manager.

All implementations of OsidManager (manager) provide methods for accessing and manipulating the various objects defined in the OSID package. A manager defines an implementation of an OSID. All other OSID objects come either directly or indirectly from the manager. New instances of the OSID objects are created either directly or indirectly by the manager. Because the OSID objects are defined using interfaces, create methods must be used instead of the new operator to create instances of the OSID objects. Create methods are used both to instantiate and persist OSID objects. Using the OsidManager class to define an OSID's implementation allows the application to change OSID implementations by changing the OsidManager package name used to load an implementation. Applications developed using managers permit OSID implementation substitution without changing the application source code. As with all managers, use the OsidLoader to load an implementation of this interface. </p>

  • author: Ben Gore
  • version: $Id: HarmoniPropertyManager.class.php,v 1.8 2007/09/13 16:04:17 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright &copy; 2005, Middlebury College

Located in /harmoni/core/oki2/agent/HarmoniPropertyManager.class.php (line 43)


	
			
Variable Summary
mixed $_dbIndex
mixed $_dbName
Method Summary
void assignConfiguration (mixed $configuration, object $configuration )
void assignOsidContext (mixed $context, object OsidContext $context )
object Property convertArrayToObject (array $propertiesArray, mixed $type, object Type $type )
boolean deleteAllProperties (string $object_id_string)
object OsidContext getOsidContext ()
integer getTypeId (mixed $type, object Type $type )
array retrieveProperties (mixed $object_id_string, int $object_id_string )
boolean storeProperties (int $object_id, mixed $properties, object Property $properties )
Variables
mixed $_dbIndex (line 45)
mixed $_dbName (line 46)
Methods
assignConfiguration (line 62)

Assigns the configuration of databases etc.

  • access: public
void assignConfiguration (mixed $configuration, object $configuration )
  • object $configuration
assignOsidContext (line 99)

Assign the context of this OsidManager.

  • access: public
  • throws: object OsidException An exception with one of the following messages defined in org.osid.OsidException: NULL_ARGUMENT
void assignOsidContext (mixed $context, object OsidContext $context )
  • object OsidContext $context
convertArrayToObject (line 304)

A public function to take a key/value array of properties as might be gathered from a web form and turns it into a useable object

object Property convertArrayToObject (array $propertiesArray, mixed $type, object Type $type )
  • array $propertiesArray
  • object Type $type
deleteAllProperties (line 277)

Delete all properties associated with an object

This is here partially to preserve the option of using non-editable agents If that ceases to be an issue, this more properly belongs in HarmoniEditableAgent.class

  • access: public
boolean deleteAllProperties (string $object_id_string)
  • string $object_id_string
getAllPropertyKeys (line 322)

Answer an array of all of the property keys inexistance

  • since: 11/1/05
  • access: public
array getAllPropertyKeys ()
getOsidContext (line 84)

Return context of this OsidManager.

  • access: public
  • throws: object OsidException
object OsidContext getOsidContext ()
getTypeId (line 224)

A public function for getting a type id (and ensuring that it exists in the database). One might consider implementing a Type manager for stuff like this that has no proper home.

  • since: 11/18/04
  • access: public
integer getTypeId (mixed $type, object Type $type )
  • object Type $type
HarmoniPropertiesManager (line 48)
void HarmoniPropertiesManager ()
retrieveProperties (line 116)

A public function that retrieves properties from the database associated with the object represented by object_id_string. Each individual type has a separate object, which is placed in the array

  • access: public
array retrieveProperties (mixed $object_id_string, int $object_id_string )
  • int $object_id_string
storeProperties (line 169)

A public function that stores all of the properties of the property object sent to it.

It deletes the old entries no matter what to avoid arduous checking to if each needed to be deleted. The properties are then rewritten to the database in the form the agent has them.

  • access: public
boolean storeProperties (int $object_id, mixed $properties, object Property $properties )
  • int $object_id
  • object Property $properties

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