Class ResultsDB

Description

Result Tracker Module Database API.

This class presents a OOP interface to the common queries needed by Result Tracker Module functionality.

  • todo: Further tease out SQL to the PhraseBook. The ResultsDBDB class should evolve into the functional API -- it needs more parameter checking and more consistency of return values to be useful. The places where a SQL statement was wrapped up for use here, but is only used by a single location in the code, might get "demoted" to pure PhraseBook status, etc.

Located in /include/classes/database/ResultsDB.inc (line 24)

DB
   |
   --CIB_DB
      |
      --ResultsDB
Method Summary
 ResultsDB ResultsDB (string $dbname, string $user, string $pass)
 string getAffiliation (int $pid)
 array getAllEntriesFor (int $pID)
 array getCompHistory (int $personID)
 string getHomeTown (int $pid)
 array getIdentificationByID (array $personIDs)
 array getPeopleByName (string $name)
 string getPersonName (int $pid)
 array getResultsFor (int $pID)
Variables

Inherited Variables

Inherited from DB

DB::$db
DB::$dbname
DB::$lastOID
DB::$password
DB::$user
Methods
Constructor ResultsDB (line 38)

ResultsDB Constructor.

Simply call the parent constructor.

  • access: public
  • todo: Add a check after connecting to make sure its a central DB and not a per-comp DB
ResultsDB ResultsDB (string $dbname, string $user, string $pass)
  • string $dbname: what database do you want to connect to
  • string $user: as what user
  • string $pass: which what password
getAffiliation (line 403)

Returns an person's team memberships

  • return: "Team[, Team2[, Team3...]]"
  • todo: Look into a CIB_Person Mapper (light weight compared to the Ragu_Person)
  • access: public
string getAffiliation (int $pid)
  • int $pid: a peopleid to look up for
getAllEntriesFor (line 278)

Returns an exhaustive set of entry information.

Returns a complete (from the Result Tracker's knowledge base perspective) set of entriess for the requested person. The returned strcuture is normally fed into the display rountines which tabulate points.

  • return: A deeply nested array whos details are highly likely to be refactored soon.
  • todo: Refactor results array into a new class
  • access: public
array getAllEntriesFor (int $pID)
  • int $pID: a peopleid to look up results for
getCompHistory (line 432)

Returns a list of all competitions a person has competed in.

  • return: array of arrays, each numerically index subitem:
    • "Comp"=>Full Competition Name
    • "Unix"=>Unix Namee of Competition
    • "Date"=>Formatted date(s) of the competition
    The subitems are entered in oldest first order.
  • access: public
array getCompHistory (int $personID)
  • int $personID: a peopleid to look up for
getHomeTown (line 381)

Returns an person's hometwon or "No adddress lists".

  • return: "City, State"
  • todo: Look into a CIB_Person Mapper (light weight compared to the Ragu_Person)
  • access: public
string getHomeTown (int $pid)
  • int $pid: a peopleid to look up for
getIdentificationByID (line 130)

Returns a list of details about all requested IDs

Returns the name, hometown (if entered), current team memberships, and any past team memberships known for each individuals in $personIDs

  • return: an array of arrays, each item is formatted as:
    • "FirstName"=>firstname,
    • "LastName"=>lastname,
    • "City"=>hometwon, only if present in DB
    • "State"=>home state, only if present in DB
    • "Teams"=>array of team abbreviations (strings) only if any memberships found
    • "DancedAs"=>array of team abbreviations (string) from result list, only if any found
    Each subitem is keyed by the the associated personID
  • todo: remove duplicate entries from DanceAs that also appear in Teams, to show only historic values in DanceAs
  • access: public
array getIdentificationByID (array $personIDs)
  • array $personIDs: Array of peopleIDs from the DB
getPeopleByName (line 57)

Return a list of possible id matches for a given name.

Given a name, attempts to find matching people. Assumes "firstname lastname" order. If ony one components, tries both. If multiple components (3 or more) tries splitting into first and last sections at each space. Case insenitive.

  • return: a list of peopleIDs from the database
  • todo: Look at reconcilling with the current Prime/Partner matching code, but remember these touch different schema databases.
  • access: public
array getPeopleByName (string $name)
  • string $name: the name to find IDs for
getPersonName (line 364)

Returns an person's name.

  • return: "Firstname Lastname"
  • todo: Look into a CIB_Person Mapper (light weight compared to the Ragu_Person)
  • access: public
string getPersonName (int $pid)
  • int $pid: a peopleid to look up for
getResultsFor (line 187)

Returns an exhaustive set of placement information.

Returns a complete (from the Result Tracker's knowledge base perspective) set of results for the requested person. The returned strcuture is normally fed into the display rountines which tabulate points.

  • return: A deeply nested array whos details are highly likely to be refactored soon.
  • todo: Refactor results array into a new class
  • access: public
array getResultsFor (int $pID)
  • int $pID: a peopleid to look up results for

Inherited Methods

Inherited From CIB_DB

 CIB_DB::CIB_DB()
 CIB_DB::addPending()
 CIB_DB::availibleUserName()
 CIB_DB::denyPermissionToUser()
 CIB_DB::expandTeamNamesFromID()
 CIB_DB::getApprovedOutsideComps()
 CIB_DB::getCaptainsEmails()
 CIB_DB::getCibServers()
 CIB_DB::getClosedComps()
 CIB_DB::getCompAnnouncements()
 CIB_DB::getCompsByDate()
 CIB_DB::getCompStatusChoices()
 CIB_DB::getCompTypes()
 CIB_DB::getCompUnixNames()
 CIB_DB::getConfigComps()
 CIB_DB::getDocumentList()
 CIB_DB::getHostedComps()
 CIB_DB::getNonApprovedOutsideComps()
 CIB_DB::getPendingKey()
 CIB_DB::getPendingKeys()
 CIB_DB::getPendingPermissions()
 CIB_DB::getSiteAnnouncements()
 CIB_DB::getSyncRequests()
 CIB_DB::getTeamAdmin()
 CIB_DB::getTeamIDs()
 CIB_DB::getTeamMemberships()
 CIB_DB::getTeamRequests()
 CIB_DB::getTeams()
 CIB_DB::getUserPasswordByName()
 CIB_DB::getUserRoles()
 CIB_DB::grantPermissionToUser()

Inherited From DB

 DB::DB()
 DB::commit()
 DB::getDBName()
 DB::getDBpass()
 DB::getDBuser()
 DB::getLastOID()
 DB::helper_limitOffset()
 DB::helper_queryToArray()
 DB::helper_queryToArrayCategories()
 DB::helper_queryToSimpleArray()
 DB::helper_singleValueQuery()
 DB::query()
 DB::rollback()
 DB::startTransaction()

Documentation generated on Tue, 25 Apr 2006 13:09:38 -0400 by phpDocumentor 1.3.0RC3