Location: PHPKode > scripts > PHP Lenex 2 > php-lenex-2/LenexClasses/LenexClub.class.php
<?

	require_once("LenexBase.class.php");
	require_once("LenexAthlete.class.php");
	require_once("LenexContact.class.php");
	require_once("LenexOfficial.class.php");
	require_once("LenexRelay.class.php");
	
	define ("LENEX_CLUB_TYPE_UNKNOWN","");
	define ("LENEX_CLUB_TYPE_CLUB","CLUB");
	define ("LENEX_CLUB_TYPE_NATIONALTEAM","NATIONALTEAM");
	define ("LENEX_CLUB_TYPE_REGIONALTEAM","REGIONALTEAM");
	define ("LENEX_CLUB_TYPE_UNATTACHED","UNATTACHED");

	class LenexClub extends LenexBase {
		
		var $athletes=array();
		var $code="";
		var $contact=NULL;
		var $name="";
		var $nation="";
		var $officials=array();
		var $region="";
		var $relays=array();
		var $shortName="";
		var $type=LENEX_CLUB_TYPE_UNKNOWN;

		function LenexClub($name,$type=LENEX_CLUB_TYPE_CLUB) {
			$this->name=$name;
			$this->type=$type;
		}
		
		/*static*/
		function fromSAX($attrs) {
			$obj =& new LenexClub(@$attrs["NAME"],@$attrs["TYPE"]);
			$obj->code=@$attrs["CODE"];
			$obj->nation=@$attrs["nation"];
			$obj->region=@$attrs["REGION"];
			$obj->shortName=@$attrs["SHORTNAME"];
			return $obj;
		}
		
		/*override*/
		function setParent(&$obj) {
			if (strcasecmp(get_class($obj),"lenexmeet")==0) $obj->addClub($this);
			else $obj->setClub($this);
		}
		
		function setContact(&$contact) {
			$this->contact =& $contact;
		}
		function addAthlete(&$athlete) {
			$this->athletes[] =& $athlete;
			$athlete->club =& $this;
		}
		function addOfficial(&$official) {
			$this->officials[] =& $official;
			$official->club =& $this;
		}
		function addRelay(&$relay) {
			$this->relays[] =& $relay;
		}
	}

?>
Return current item: PHP Lenex 2