Class StorablePrimitive

Description

This interface allows for the storage into a database (or other medium) the data contained in a Primitive data type.

  • version: $Id: StorablePrimitive.interface.php,v 1.7 2007/09/04 20:25:31 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/dataManager/StorablePrimitive.interface.php (line 13)


	
			
Method Summary
void alterQuery (mixed $query)
integer insert (integer $dbID)
string makeSearchString (ref $value, [int $searchType = SEARCH_TYPE_EQUALS])
void prune (integer $dbID, integer $dataID)
void update (integer $dbID, integer $dataID)
Methods
alterQuery (line 71)

Takes an existing SelectQuery and adds a table join and some columns so that when it is executed the actual data can be retrieved from the row. The join condition must be "fk_data = data_id_field", since the field "fk_data" is already part of the DataManager's table structure.

  • access: public
void alterQuery (mixed $query)
createAndPopulate (line 27)

Takes a single database row, which would contain the columns added by alterQuery() and extracts the values to setup the object with the appropriate data.

  • static:
  • access: public
object StorablePrimitive createAndPopulate (array $dbRow)
  • array $dbRow
insert (line 51)

Inserts a new row into the Database with the data contained in the object.

  • return: Returns the new ID of the data stored.
  • access: public
integer insert (integer $dbID)
  • integer $dbID: The DBHandler database ID to query.
makeSearchString (line 39)

Returns a string that could be inserted into an SQL query's WHERE clause, based on the Primitive value that is passed. It is used when searching for datasets that contain a certain field=value pair.

  • return: or NULL if no searching is allowed.
  • static:
string makeSearchString (ref $value, [int $searchType = SEARCH_TYPE_EQUALS])
  • int $searchType: One of the SEARCH_TYPE_* constants, defining what type of search this should be (ie, equals, contains, greater than, less than, etc)
  • ref $value: object $value The Primitive object to search for.
prune (line 80)

Deletes the data row from the appropriate table.

  • access: public
void prune (integer $dbID, integer $dataID)
  • integer $dbID: The DBHandler database ID to query.
  • integer $dataID: The ID in the database of the data to be deleted.
update (line 61)

Uses the ID passed and updates the database row with new data.

  • access: public
void update (integer $dbID, integer $dataID)
  • integer $dbID: The DBHandler database ID to query.
  • integer $dataID: The ID in the database of the data to be updated.

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