ok, so if we were talking Java, perhaps you are looking for
information that allows you to build 'accessor' and 'mutator' methods?
If so, then your example should work (syntax aside). Here's another
'test' example that I just whipped up and tested that shows you can
use any method name you wish.

<?php
class test {

 private $thing;

 function setThing($val) {
   $this->thing = $val;
 }


 function getThing() {
   return $this->thing;
 }

}

$t = new test;

// Show that thing is empty
print $t->getThing() . "\n";

// Set thing to 'Thing'
$t->setThing('Thing');

// show that thing contains 'Thing'
print $t->getThing() . "\n";
?>


If I'm still on the wrong path I apologize. I probably shouldn't be
trying to provide advice on cold medicine ;-)



On 9/22/06, Chris Boget <[EMAIL PROTECTED]> wrote:
> well, perhaps I'm not seeing what it is that you're looking for.

No, I'm not sure you are.  Take a look at my sample code again.  Pay
particular attention to how both $bob and $Bob are defined.

class MyClass {

  private $bob;

  public $Bob {
    set( $var ) {
      $this->bob = $var;

    }
    get() {
      return $this->bob;

    }
  }
}

thnx,
Chris




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to