On Thu, Sep 23, 2010 at 12:24 AM, Peter Lind wrote:
> On 23 September 2010 02:14, Daniel Kolbo wrote:
>
> *snip*
>
> > On 9/22/2010 9:11 AM, chris h wrote:
> > Say you have two classes: human and male. Further, say male extends
> > human. Let's say you have a human object. Then later you want
Am 23.09.2010 08:24, schrieb Peter Lind:
On 23 September 2010 02:14, Daniel Kolbo wrote:
*snip*
On 9/22/2010 9:11 AM, chris h wrote:
Say you have two classes: human and male. Further, say male extends
human. Let's say you have a human object. Then later you want to make
that human object a
On 23 September 2010 02:14, Daniel Kolbo wrote:
*snip*
> On 9/22/2010 9:11 AM, chris h wrote:
> Say you have two classes: human and male. Further, say male extends
> human. Let's say you have a human object. Then later you want to make
> that human object a male object. This seems to be a pr
On 9/22/2010 9:11 AM, chris h wrote:
>
> You could create a method of class B that takes an object of class A as
> a parameter and copies each property line by line (or method of class A
> that takes an object of class B...). If you don't want to add a method
> you could just do the same thing, b
On Wed, Sep 22, 2010 at 5:35 AM, Daniel Kolbo wrote:
> Hello PHPers,
>
> I have:
>
> class A {
>...code
> }
>
> class B extends A {
>...code
> }
>
> $a = new A();
>
> $b = new B();
>
after looking back over your situation, which looks strange, why not use
composition at this leve
On Wed, Sep 22, 2010 at 5:35 AM, Daniel Kolbo wrote:
> Hello PHPers,
>
> I have:
>
> class A {
>...code
> }
>
> class B extends A {
>...code
> }
>
> $a = new A();
>
> $b = new B();
>
> I would like to get all of the properties of $a into $b by value.
first off you have to be car
You could create a method of class B that takes an object of class A as a
parameter and copies each property line by line (or method of class A that
takes an object of class B...). If you don't want to add a method you could
just do the same thing, but procedurally. The issue with this (aside fro
Maybe statics members can help you with this ...
On Wed, Sep 22, 2010 at 07:35, Daniel Kolbo wrote:
> Hello PHPers,
>
> I have:
>
> class A {
>...code
> }
>
> class B extends A {
>...code
> }
>
> $a = new A();
>
> $b = new B();
>
> I would like to get all of the properties of $a
Hello PHPers,
I have:
class A {
...code
}
class B extends A {
...code
}
$a = new A();
$b = new B();
I would like to get all of the properties of $a into $b by value. Class
A extends 3 other classes. I would like a way to not have to manage a
'copy' method in B if A or one of
9 matches
Mail list logo