Object parameter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
michel77
Forum Newbie
Posts: 17
Joined: Sun Nov 06, 2005 4:57 am

Object parameter

Post by michel77 »

I'm going to set a member with an object via argument:

class A {...}
class B {
privat $objectA;
public function setObjectA ($parameterObjectA)
{
$this->objectA = $parameterObjectA;
}
}

and a php script:

$objetcA = new A();
$obejctB = new B();
$objectB->setObjectA($objectA); // doesn't work

Please, how to do it ?
Post Reply