* */ class apiModel { public function __construct( /* polymorphic */ ) { if (func_num_args() == 1 && 'array' == gettype(func_get_arg(0))) { // Initialize the model with the array's contents. $array = func_get_arg(0); foreach ($array as $key => $val) { $this->$key = $val; } } } }