Lets say that I have an array that I want to convert to a value object.
My value object class is as follows:
/* file UserVO.php*/
class UserVO
{
pu
First, conversion of data to an array object for UserVO should be done with ArrayObject
so
class UserVO extends ArrayObject
{
}
You are trying to use the factory method pattern and your code seems to be right, though you seem to have an forgotten to define $result as an array ($result = array()).
You can also use the ReflectionClass to pass constructor arguments as well as such:
$rc = new ReflectionClass($vo);
$rc->newInstanceArgs($data[$i]);
To "autoload" your UserVO object, you should use the spl_autoload_register function with a php include path.