public function getProperties_asList($prefix = null)
{
$return = array();
// get a list of the properties of the $params object
$refObj = new ReflectionObject($this);
$refProps = $refObj->getProperties(ReflectionProperty::IS_PUBLIC);
// convert each property into an array entry
foreach ($refProps as $refProp) {
$propKey = $refProp->getName();
$retKey = $propKey;
// do we need to enforce the prefix?
if ($prefix !== null && substr($this->{$propKey}, 0, strlen($prefix)) !== $prefix) {
// yes we do
$retKey = $prefix . $propKey;
}
// set the value
$return[$retKey] = $this->{$propKey};
}
// return the array that we've built
return $return;
}