Marian Kostadinov wrote:
  public getter fullName { // may also have ()
   return "{$this->firstName} {$this->lastName}";
  }

  public setter fullName ($value) { // may also not have ($value) but
a special var.
   list ($this->firstName, $this->lastName) = explode (' ', $value, 2);
  }

This can be easily done with

function __get($name)
{
        $get = "get_$name";

        return $this->$get();
}

function __set($name, $value)
{
        $set = "set_$name";

        $this->$set($value);
}

in your base class (the function names are then get_fullName/set_fullName.

- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to