I\'m trying to make a PHP (5) object that can iterate through its properties, building an SQL query based only on its public properties, not its private ones.
You can easily use the Reflection API to check the visibility of properties:
$rp = new \ReflectionProperty($object, $property);
if ($rp->isPrivate) {
// Do if the property is private
} else {
// Do if the property is public or protected
}