public function Get($objectclass, $id, $cache_timeout = null)
	{
		if (is_null($cache_timeout)) $cache_timeout = $this->ObjectCacheTimeout;

		if (strlen($objectclass) < 1)
		{
			throw new Exception("\$objectclass argument is required");
		}
		if (strlen($id) < 1)
		{
			throw new Exception("\$id argument is required for $objectclass");
		}

		// see if this object was cached & if so return it
		$obj = $cache_timeout == 0 ? null : $this->GetCache($objectclass,$id);
		if ($obj) return $obj;

		$pkm = $this->GetPrimaryKeyMap($objectclass);

		if (!$pkm) throw new Exception("Table for '$objectclass' has no primary key");

		$criteria = new Criteria();
		$criteria->PrimaryKeyField = "`" . $pkm->TableName . "`.`" . $pkm->ColumnName . "`";
		$criteria->PrimaryKeyValue = $id;

		$ds = $this->Query($objectclass, $criteria);

		// this is cacheable
		$ds->UnableToCache = false;

		if (!$obj = $ds->Next())
		{
			require_once("NotFoundException.php");
			throw new NotFoundException("$objectclass with primary key of $id not found");
		}

		// cache the object for future use
		$this->SetCache($objectclass,$id,$obj,$cache_timeout);

		return $obj;
	}
public function Get($objectclass, $id, $cache_timeout = null)
	{
		if (is_null($cache_timeout)) $cache_timeout = $this->ObjectCacheTimeout;

		if (strlen($objectclass) < 1)
		{
			throw new Exception("\$objectclass argument is required");
		}
		if (strlen($id) < 1)
		{
			throw new Exception("\$id argument is required for $objectclass");
		}

		// see if this object was cached & if so return it
		$obj = $cache_timeout == 0 ? null : $this->GetCache($objectclass,$id);
		if ($obj) return $obj;

		$pkm = $this->GetPrimaryKeyMap($objectclass);

		if (!$pkm) throw new Exception("Table for '$objectclass' has no primary key");

		$criteria = new Criteria();
		$criteria->PrimaryKeyField = "`" . $pkm->TableName . "`.`" . $pkm->ColumnName . "`";
		$criteria->PrimaryKeyValue = $id;

		$ds = $this->Query($objectclass, $criteria);

		// this is cacheable
		$ds->UnableToCache = false;

		if (!$obj = $ds->Next())
		{
			require_once("NotFoundException.php");
			throw new NotFoundException("$objectclass with primary key of $id not found");
		}

		// cache the object for future use
		$this->SetCache($objectclass,$id,$obj,$cache_timeout);

		return $obj;
	}
public function Get ( $ objectclass , $ id , $ cache_timeout = null ) { if ( is_null ( $ cache_timeout ) ) $ cache_timeout = $ this -> ObjectCacheTimeout ; if ( strlen ( $ objectclass ) < 1 ) { throw new Exception ( "\$objectclass argument is required" ) ; } if ( strlen ( $ id ) < 1 ) { throw new Exception ( "\$id argument is required for $objectclass" ) ; } // see if this object was cached & if so return it
 $ obj = $ cache_timeout == 0 ? null : $ this -> GetCache ( $ objectclass , $ id ) ; if ( $ obj ) return $ obj ; $ pkm = $ this -> GetPrimaryKeyMap ( $ objectclass ) ; if ( ! $ pkm ) throw new Exception ( "Table for '$objectclass' has no primary key" ) ; $ criteria = new Criteria ( ) ; $ criteria -> PrimaryKeyField = "`" . $ pkm -> TableName . "`.`" . $ pkm -> ColumnName . "`" ; $ criteria -> PrimaryKeyValue = $ id ; $ ds = $ this -> Query ( $ objectclass , $ criteria ) ; // this is cacheable
 $ ds -> UnableToCache = false ; if ( ! $ obj = $ ds -> Next ( ) ) { require_once ( "NotFoundException.php" ) ; throw new NotFoundException ( "$objectclass with primary key of $id not found" ) ; } // cache the object for future use
 $ this -> SetCache ( $ objectclass , $ id , $ obj , $ cache_timeout ) ; return $ obj ; }
Get one instance of an object based on it's primary key value

@access public
@param string $objectclass to query
@param variant $id the value of the primary key
@param int cache timeout (in seconds).  Default is Phreezer->ObjectCacheTimeout.  Set to 0 for no cache
@return Phreezable
Get one instance of an object based on it s primary key value