Re: DB_DataObject_FormBuilder: linkNewValue HOWTO

From: Date: Fri, 11 Mar 2005 18:19:29 +0000
Subject: Re: DB_DataObject_FormBuilder: linkNewValue HOWTO
References: 1 2 3 4 5  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17970@lists.php.net to get a copy of this message
On Fri, 11 Mar 2005 18:53:15 +0100, Dot Deb <dotdeb@gmail.com> wrote: > On Fri, 11 Mar 2005 09:09:06 -0800, Justin Patrin <papercrane@gmail.com> wrote: > > This is in the ini file? If so, I stand corrected. > > > Yes, right. Let's back up a bit here. In your original e-mail you said: > I tried with > linkNewValue=false > in the .ini file and > $fb_linkNewValue=true > in the autogenerated subclass definition but I does not work. How exactly did this not work? Did it always do a linkNewValue? Never? > > I managed it to work using > $fb =& DB_DataObject_FormBuilder::create($paper); > $fb->linkNewValue=array('author_id','type_id'); > in the main script. What if you do $paper->fb_linkNewValue = array('author_id','type_id'); before the ::create call? How about if you set it as a var in the class? I just tried setting fb_linkNewValue in one of my classes and it seemed to work fine. I would recommend setting it in the Paper class or as $paper->fb_linkNewValue instead of $fb->linkNewValue as it could be possible for the DO to overwrite that. Yeah, I know, there are 5 places to set options and it can be confusing. > > I also tried from the ini file and it does not work; but I'm certainly > missing something. > Should it reads as > linkNewValue=author_id:true,type_id:true ? > Well, that should work fine, but I don't suggest doing that unless you're using a different ini file for every table or your link fields are the same for every table. The reason I say this is that normally the same ini file is used for all of your tables, so those configuration options are used for *every* table as a default. If you set the option in your code ($fb->linkNewValue = ... or $do->fb_linkNewValue = ...) or in your DO class, it will be overwritten. But if you don't specify it, any options in the ini file will be applied to all tables. -- Justin Patrin

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