Date index for Sep 2003
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [achievo] add functionality (type of node)
Hi,
Golovnya, Yury wrote:
I realized your first approache (add non-standard $g_pageVars atktype and
hack slightly onetomanyrelations). Its work, but your third approache like
me more. I try to realize it.
Make sure you use the correct parameter for the editPage() call (in my
previous message I left them all out).
I had some more thoughts about what you're trying to realize, and what
this actually is is 'record polymorphism'.
What would really be nice to have is a generic way of doing a thing like
this.
Suppose in the future you could do this:
class contract extends atkNode
{
function contract()
{
.....
$this->setDiscriminator("type",
array("hosting"=>"hosting_contract",
"support"=>"support_contract"));
}
}
class hosting_contract extends contract
{
function hosting_contract()
{
...
// all specific hosting contract stuff.
}
}
etc...
So by defining which field is the discriminator, and by mapping
discriminator values to nodes, the system would then be able to
instantiate the correct subnode.
I've toyed around with a similar feature a while ago, but abandoned it
because it would take too much time for what I needed it for at that time.
Greetings,
Ivo