Hi, my question is the following :
How can you access a method of an object
from an another object?
For example if I have 2 classes:
class class1
{
function method1 ()
{
..
}
}
class class2
{
function method2 ()
{
..
}
}
and 2 objects :
$object1 = new class1;
$object2 = new class2;
How can I access the method1 from the
object2?
I know it's possible to do the following in
class2 :
global $object1;
$object1->method1();
but I don't think it's a good oo practice 🙂
Thanks for your answers.
Natasha