|
Posted by Andy Hassall on 12/31/06 16:31
On 31 Dec 2006 03:20:43 -0800, "howa" <howachen@gmail.com> wrote:
>for example, i have a class, e.g.
>
>class User {
>
>
>var $name;
>var $age;
>var $blah;
>
>}
>
>The user has many atttibutes, i want to provide each of them with
>getter & setter function, but it is time consuming to type all the
>functions for all attributes...
>
>is it possible to dynamically create function? so I only need to
>declare one setter, and one getter?
Two methods here:
http://www.php.net/manual/en/language.oop5.overloading.php
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|