SV: [PEAR] getLinks PROBLEM SOLVED!

From: Date: Thu, 01 May 2003 19:26:37 +0000
Subject: SV: [PEAR] getLinks PROBLEM SOLVED!
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5173@lists.php.net to get a copy of this message
Ok, first of all, everyone out there, make sure that you are loading all database classes that you are linking to... Such an obvious thing can be tricky sometimes ;-) But, in fact the docs more or less states that loading the class will be done automatically, it says that "getLinks" needs to have the "require_prefix" set in order to find the other classes ... Anyway, requiering the other classes "as usual solves the problem" Took almost two days of trouble shooting, Pew! Also, you ca be fooled by the docs that the syntax for calling the values in the linked object is: $dbobject->_linkrow_id_linkedfield when it really is: $dbobject->_linkrow_id->linkedfield which, if you think about it, is the only syntax that can work as the linked object still is AN OBJECT ... Anyway, problem solved, some hints for the docs maybe and a big thanks to Alan and Xavier for directions. One thing that still bugs me though is that the _link_loaded prperty still says "bool(false)", docs says it should be "1" when linking succeeded. Finally, a tip: I set debug = 5 in the .ini file, that gave me a lot of information about what the db-package tried to do ... Best regards Niklas Eriksson -----Ursprungligt meddelande----- Fran: Alan Knowles [mailto:alan@akbkhome.com] Skickat: den 1 maj 2003 17:22 Till: pear-general@lists.php.net; Niklas Eriksson Kopia: pear-general@lists.php.net Amne: [PEAR] Re: getLinks Niklas Eriksson wrote: > Dear Subscribers, > > I have severe problems implementing getlinks() in my database application, > no matter how I do it i just get the following when I make a var_dump of the > DataObject I am trying to link from ... might help with a <PRE> tag.. ok, looks like a bit of debugging could be added to getLinks().. after you have called getLinks() and it fails - try doing print_r($_DB_DATAOBJECT); which should print dataobjects 'quasi' static vars.. I suspect it's just not loading the link ini file for some reason.. Regards Alan > > object(dataobjects_image)(22) { ["__table"]=> string(5) "Image" > ["id"]=> > string(1) "9" ["name"]=> string(4) "test" > ["uploaded"]=> string(14) > "20030429223731" ["ImageCategorys_id"]=> string(1) "1" > ["description"]=> > string(0) "" ["photograph"]=> string(0) "" > ["file"]=> string(9) "bauta.jpg" > ["_DB_DataObject_version"]=> string(3) "1.0" ["N"]=> int(1) > ["_database_dsn"]=> string(0) "" ["_database_dsn_md5"]=> > string(32) > "07769e23fb5775ee91094dfe908961c2" ["_database"]=> string(4) > "test" > ["_condition"]=> string(0) "" ["_group_by"]=> string(0) > "" ["_order_by"]=> > string(0) "" ["_limit"]=> string(0) "" > ["_data_select"]=> string(1) "*" > ["_DB_resultid"]=> int(0) ["_link_loaded"]=> bool(false) > ["_join"]=> > string(0) "" ["_lastError"]=> bool(false) } > > > > I have tried both using a .ini file and not, the "link field" in the table > is correctly named and the dataObjects_prefix is corrctly set int the db.ini > file... But getlinks simply will not get any links!!! > > Does anyone have a clue, is there a setup parameter I have missed?? > > Best Regards > > Niklas Eriksson > > -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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