If php have annotations feature its be very simple. class MyClass implements Jsonable { private $name; private $age; Transient private $dtCreated;// or JsonIgnore or JsonTransient }
all properties will be encoded, except transient. Otherwise,php can have jasonable interface and class that implements it, by default encode all properties(private,default,public,protected), except properties in the __jsonTransient. class MyClass implements Jsonable { private $name; private $age; private $id; public function __jsonTransient() { return array('id'); } } -- Mathias Grimm Sun Certified Java Programmer 6.0 #SUN604760 Zend Certified Engineer #ZEND006756 http://mathiasgrimm.com.br http://phpempregos.com.br