data object getLinks

From: Date: Thu, 29 May 2003 04:50:19 +0000
Subject: data object getLinks
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5676@lists.php.net to get a copy of this message
Hi all, Hope this doesn't sound too strange. Does getLinks() support MULTIPLE, UNIQUE links to the same table? That is, pointers to different instances. In my case I have a Reservation table which has columns for two trains holding foriegn ids, which indexing a Train table. (This represents a 2:N relation. Since the 2 is fixed by the real world, I saw no point in an M:N table when two columns would do it.) CREATE TABLE tReservation ( tTrain_id_1 smallint(6) NOT NULL default '0', tTrain_id_2 smallint(6) NOT NULL default '0', ... ); CREATE TABLE tTrain ( trainId smallint(6) NOT NULL auto_increment, ... ); I have experimented with something like this in the links table [tReservation] tTrain_id_1 = tTrain:trainId tTrain_id_2 = tTrain:trainId but it's not reliable. getLinks() is working well in other parts of this same system, but I wonder if I'm abusing it here. Perhaps I need to override getLinks to explicitly do those two loads? Thanks, -- Mitchell Perilstein mitch at enetis dot net www.enetis.net/~mitch

« previous php.pear.general (#5676) next »