
Untitled
By: a guest on
May 25th, 2012 | syntax:
None | size: 0.69 KB | hits: 12 | expires: Never
using ReflectionClass to read the class Properties
class Certificate {
private $isin;
private $tradingMarket;
private $currency;
private $issuer;
private $issuingPrice;
private $currentPrice;
private $priceHistory;
private $documents;
private $serializer;
}
function getProperties($object) {
$ref = new ReflectionClass(get_class($object));
foreach ($reg->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED | ReflectionProperty::IS_PRIVATE) as $prop) {
if (is_object($prop->getValue($object)) getProperties($prop->getValue($object));
else echo get_class($object)." => ".$prop->getName();
}
}