Re: Links inside DataObject

From: Date: Tue, 28 Jun 2005 18:23:12 +0000
Subject: Re: Links inside DataObject
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19809@lists.php.net to get a copy of this message
Justin Patrin wrote:
On 6/28/05, Rodrigo Alvarez <papipo@gmail.com> wrote:
is there any way of specifying dataobject links from within the dataobject itself? This should be like Frombuilder style: i want something like that $fb_textFields to specify DO links, instead of .ini file, since its use is not possible atm:
Use of an ini file is not possible? I don't understand how that can be. hehe. I'm developing a Framework that has some "core" content types. New content types would be added, but their links shouldn't go into the main links.ini file.
You can set both the table info (columns and types) and link data by overriding functions in yoru DOs. Someone (don't remember who) altered the generator to do this but I don't think the code was ever cimitted to DB_DO. class MyDO extends DB_DataObject { //... function table() {
    return array('field1' => DB_DATAOBJECT_INT, 'field2' => DB_DATAOBJECT_STR);
} function links() {
    return array('field1' => 'table:field');
} } Ok, I'll try this, thanks.


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