public function getList($propName)
{
// do we have the property at all?
if (!isset($this->{$propName})) {
// no ... send back an empty list
return array();
}
// is the property already a list?
if (is_array($this->{$propName})) {
// yes ... no conversion needed
return $this->{$propName};
}
// is the property something we can convert?
if (is_object($this->{$propName})) {
// yes
$return = array();
foreach ($this->{$propName} as $key => $value) {
$return[$key] = $value;
}
return $return;
}
// if we get here, the property isn't naturally a list
return array();
}