Greg Beaver wrote:
Wouter,
you could try this adding this method to each object you need
blessings from:
function bless($classname)
{
if ($classname == get_class($this)) {
return $this;
}
$vars = get_object_vars($this);
$ret = new $classname;
return
Hi Wouter,
The only disadvantage to assigning to $this is that it may not be
supported in PHP 5 - php-internals discussion has described it as a bad
idea. I would get beta 2 and test it out, see what happens.
Incidentally, you don't need to unset new, and I would use
$this = $New;
Regards,
Hello
Just out of curiosity why do you need such a function? I'm no perl
programmer and have very little knowledge of the language ... yet ; )
but the way you describe it it seems to me that you have a fundamentle
design flaw in your script if you need to change types on the fly that are
in
[EMAIL PROTECTED] wrote:
Hello
Just out of curiosity why do you need such a function? I'm no
perl programmer and have very little knowledge of the
language ... yet ; ) but the way you describe it it seems to
me that you have a fundamentle design flaw in your script if
you need to change
Wouter,
you could try this adding this method to each object you need blessings
from:
function bless($classname)
{
if ($classname == get_class($this)) {
return $this;
}
$vars = get_object_vars($this);
$ret = new $classname;
return $ret-loadValues($vars);
}
function
5 matches
Mail list logo