Documentation is available at Competitor.inc
- <?php
- /**
- * Competitor Class.
- *
- * A competitor is a subtype of {@link Person} that
- * knows about finding the partners of a given person.
- *
- * This file is part of CompInaBox.
- * @copyright Copyright 2001-2005. Eric D. Nielsen, All rights reserverd.
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @author Eric D. Nielsen <nielsene@alum.mit.edu>
- *
- * @package ObjectRelationalMappingLayer
- */
- /**
- * Competitor
- *
- * Competitors are a subtype of {@link Person} that
- * knows how to find the partners of the person.
- * @package ObjectRelationalMappingLayer
- * @access public
- */
- class Competitor extends Person
- {
- function Competitor($db=0, $id=0)
- {
- Person::Person($db,$id);
- }
- /**
- * Returns the peopleid's of this Competitor's partners
- *
- * Allows querying by role "lead" or "follow" or both
- * via the "*"/default. Returns the list of peopleid's from
- * the database.
- * @param string $role which role partner's to find, defaults to
- * all roles. Enter "lead" to get partner's leading this
- * Competitor. Enter "follow" to get partner's following this
- * Competitor
- * @return array list of peopleid meeting the requested criteria
- */
- function getPartners($role="")
- {
- $db = $this->db;
- $temp = array();
- $queryID= $this->getID();
- $isFollow = (($role == "follow") ? TRUE : FALSE);
- if (!$isFollow)
- {
- $query = "SELECT leader FROM COUPLES where follower=$queryID;";
- $result = $db->query($query);
- $numLeads = $result->numRows();
- for ($i=0;$i<$numLeads;$i++)
- {
- $lead = $result->getRowAt($i);
- array_push($temp,$lead[0]);
- }
- }
- $isLead = (($role == "lead") ? TRUE : FALSE);
- if (!$isLead)
- {
- $query = "SELECT follower FROM COUPLES where leader=$queryID;";
- $result = $this->db->query($query);
- $numFollowss = $result->numRows();
- for ($i=0;$i<$numFollowss;$i++)
- {
- $follow = $result->getRowAt($i);
- array_push($temp,$follow[0]);
- }
- }
- return $temp;
- }
- }
- ?>
Documentation generated on Tue, 25 Apr 2006 13:00:25 -0400 by phpDocumentor 1.3.0RC3