Re: array of objects???
| From: | J Smith | Date: | Fri, 10 May 2002 17:34:24 +0000 |
| Subject: | Re: array of objects??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96968@lists.php.net to get a copy of this message | ||
Might just be a typo, but in the function prototype for AddUser(), you have
$oUser, but the array_push() argument says $objUser.
J
J. Anderson Scarbrough wrote:
> I have two classes. Organization and users.
>
> In the organization class I am try to keep an array of user objects but it
> does not seem to be taking. Can any help? See code below.
>
> class Organization
> {
> var $users = array();
>
> function AddUser($oUser)
> {
> array_push($this->users, $objUser);
> }
>
> function numberOfUsers()
> {
> return count($this->users);
> }
>
> }
>